[問題] 想請教台師資教計概幾題程式題

看板Grad-ProbAsk作者 (Hello~)時間15年前 (2009/03/16 23:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
1.what is th output of the following c++ program? int main(){ int x=0 , y=0 ; if (++x == 1 || y++ ==1) cout << "(1)" << x << ',' << y << end1; if (++x == 1 || y++ ==1) cout << "(2)" << x << ',' << y << end1; return 0; } 2.what is th output of the following c++ program? int main(){ char x='A'; switch (x++) { case 'A': cout << "x=A" ; case 'B': cout << "x=B" ; case 'C': cout << "x=C" ; } return 0; } 3.which element of array A is changed after invoking modifyArray()? what does the Array A become after modifyArray() returns to the main program? modifyArray(int b[] , size){ b = &b[3] ; b[3] = 0 ; } int main (void) { int A[] = {1,2,3,4,5,6,7,8,9}; modifyArray(A,9); return 0 ; } 感謝各位的幫助<(_ _)> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.161.74.8
文章代碼(AID): #19lcw6wE (Grad-ProbAsk)
文章代碼(AID): #19lcw6wE (Grad-ProbAsk)