作者FQOO (Hello~)
看板Grad-ProbAsk
標題[問題] 想請教台師資教計概幾題程式題
時間Mon Mar 16 23:21:41 2009
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