作者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