《C++程序设计基础(第4版)(上)——林伟健》

作者:林伟健  出版社:电子工业出版社

题目 题型
下列数组定义语句中,不合法的是(  )。 单选
已知int a[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, *p = a;,不能表示数组a中元素的式子是( )? 单选
已知int a[] = { 0,2,4,6,8,10 }, *p = a+1;其值等于0的表达式是( )。 单选
以下不能对二维数组a进行正确初始化的语句是(  )。 单选
已知int a[][3] = { { 0, 1 }, { 2, 3, 4 }, { 5, 6 }, { 7 } };则a[2][1]的值是(  )。 单选
已知int a[3][3] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };  不能表示数组元素a[2][1]的地址是()。 单选
已知char *a[]={ "fortran", " basic", "pascal", "java", "c++" };,则cout< 单选
若用数组名作为调用函数的实参,则传递给形参的是()。 单选
设有char *s1="ABCDE", *s2="ABCDE",*s3=s1;,下列表达式中值等于true的是( )。 单选
设char *s1, *s2;分别指向两个字符串,可以判断字符串s1和s2是否相等的表达式为(  )。 单选
设char *s1, *s2;分别指向两个字符串,可以判断字符串s1是否大于字符串s2的表达式为(  )。 单选
阅读下列程序,写出运行结果: #include <iostream> using namespace std; int main() { int i, count=0, sum=0; double average; int a[] = 问答
阅读下列程序,写出运行结果: #include <iostream> using namespace std; int main() { int a[9] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int *p 问答
阅读下列程序,写出运行结果: #include <iostream> #include <iomanip> using namespace std; const int N = 5; int main() { int a[N 问答
阅读下列程序,写出运行结果: #include <iostream> using namespace std; int f(int [],int); int main() { int a[] = { -1, 3, 5, -7, 9, - 问答
阅读下列程序,写出运行结果: #include <iostream> using namespace std; int f( int [][3], int, int ); int main() { int a[][3] = { 0, 1 问答
阅读下列程序,写出运行结果: #include <iostream> using namespace std; void test1( int *a1 ) { a1 = new int( 5 ); cout << " 问答
阅读下列程序,写出运行结果: #include <iostream> using namespace std; int main() { char s[] = "abccda"; int i; char c; for 问答
阅读下列程序,写出运行结果: #include <iostream> using namespace std; int main() { char *str[] = { "c++", "basic" 问答
阅读下列程序,写出运行结果: #include <iostream> using namespace std; int main() { char s1[] = "Fortran", s2[] = "Fox 问答