单项选择题

要定义数组a,使得其中每个元素的数据依次为3,9,4,8,0,0,0,错误的定义语句是 ( )。

A.int a[]=3,9,4,8,0,0,0;
B.int a[9]=3,9,4,8,0,0,0;
C.int a[]=3,9,4,8;
D.int a[7]=3,9,4,8,0,0,0;
<上一题 目录 下一题>
热门 试题

单项选择题
对下列程序的描述正确的是( )。 #include <iostream> using namespace std; int fuc(int,int); int main() cout<<fuc(1,10)<<endl; return 0; int fuc(int x,int y) return x*x+y*y;
A.该函数的定义和调用方式都是错误的
B.该函数的定义和调用方式都是正确的
C.该函数调用方式正确,但函数定义错误
D.函数定义正确,但函数调用方式错误
单项选择题
假定有如下程序: #include <iostream> using namespace std; int s =0; class example static int n; public: example(int i) n=i; static void add( ) s+=n; ; int example::n=0; int main( ) example a(2),b(5); example::add(); cout<<s<<endl; return 0;程序运行后输出结果为( )。
A.2
B.3
C.7
D.5
相关试题
  • 假定有如下程序: #include <iostream...
  • 对下列程序的描述正确的是( )。 #incl...
  • 执行下面程序后输出的结果是( )。 #in...
  • 下面关于虚函数的描述正确的是( )。
  • 下列关于类与对象的说法不正确的是( )。