第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

幾個小疑問

幾個小疑問

C C++
xungeer29 2017-10-21 14:45:45
#include<iostream> //#include<cstring>???//為什么這里注釋了程序還能正常運行?程序里有strcpy、strlen using?namespace?std; const?int?SLEN?=?30; struct?student { ?char?fullname[SLEN]; ?char?hobby[SLEN]; ?int?ooplevel; }; int?getinfo(student?pa[],?int?n); void?display1(student?st); void?display2(const?student?*ps); void?display3(const?student?pa[],?int?n); int?main() { ?cout?<<?"Enter?class?size:?"; ?int?class_size; ?cin?>>?class_size; ?while?(cin.get()?!=?'\n') ??continue; ?student?*ptr_stu?=?new?student[class_size]; ?int?entered?=?getinfo(ptr_stu,?class_size); ?for?(int?i?=?0;?i?<?entered;?i++) ?{ ??display1(ptr_stu[i]); ??display2(&ptr_stu[i]); ?} ?display3(ptr_stu,?entered); ?delete[]?ptr_stu; ?cout?<<?"Done\n"; ?return?0; } int?getinfo(student?pa[],?int?n) { ?int?num_array_elem?=?n; ?char?temp[SLEN]; ?for?(int?i?=?0;?i?<?n;?i++) ?{ ??cout?<<?"Enter?name:?"; ??cin.getline(temp,?SLEN); ??bool?blank_line?=?true;???????????????????? ??for?(unsigned?j?=?0;?j?<?strlen(temp);?j++)//strlen ??{?????????????????????????????????????????? ???if?(!isspace(temp[j]))???????????????????? ???{????????????????????????????????????????? ????blank_line?=?false;?????????????????????? ????break;??????????????????????????????????? ???} ??} ??if?(blank_line) ??{ ???num_array_elem?=?i; ???break; ??} ??strcpy_s(pa[i].fullname,?temp);???????????????//strcpy ??cout?<<?"Enter?hobby:?"; ??cin.getline(pa[i].hobby,?SLEN); ??cout?<<?"Enter?ooplevel:?"; ??cin?>>?pa[i].ooplevel; ??cin.get();????????????????????????????????//這一句什么作用? ?} ?cout?<<?endl; ?return?num_array_elem; } void?display1(student?st) { ?cout?<<?st.fullname?<<?'\t'?<<?st.hobby?<<?'\t'?<<?st.ooplevel?<<?endl; } void?display2(const?student?*ps) { ?cout?<<?ps->fullname?<<?'\t'?<<?ps->hobby?<<?'\t'?<<?ps->ooplevel?<<?endl; } void?display3(const?student?pa[],?int?n) { ?for?(int?i?=?0;?i?<?n;?i++) ?{ ??cout?<<?pa[i].fullname?<<?'\t' ???<<?pa[i].hobby?<<?'\t' ???<<?pa[i].ooplevel?<<?endl; ?} }
查看完整描述

1 回答

已采納
?
木柘

TA貢獻143條經(jīng)驗 獲得超94個贊

在我的IDE里無法通過編譯,你運行前重新編譯覆蓋之前的。

查看完整回答
反對 回復(fù) 2017-10-21
  • 1 回答
  • 0 關(guān)注
  • 1389 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號