已知: int a=100; void Func(ref int b) { …… } 则下列函数调用正确的是()
第1题:
下面程序的运行结果是
#include<iostream.h>
Void main( )
{
int num=1;
int &ref=num;
ref=ref+2;
cout < < num;
num=num+3;
cout < < ref < <endl;
}
A.13
B.16
C.36
D.33
第2题:
类clasg one在声明func成员函数时发生错误,出错原因是______。
class one
private:
int a;
public:
void func(two&);
};
class two
{
private:
int b;
friend vold one::func(two&);
};
void one::func(two&r)
{
a=r.b;
}
第3题:
下列程序执行后的输出结果是______。
A.hello
B.hel
C.hlo
D.hlm void func1 (int i); void func2 (int i); char st[]="hello,friend!"; void func1(int i) { printf("%c",st[i]); if(i<3){ i+=2;func2(i); } } void func2 (int i) { printf("%c",st[i]); if(i<3){ i+=2;func1(i); } } main() { int i=0;func1(i);printf("\n");}
第4题:
下列程序的输出结果是 #include<iostream.h> int b=2; int func(int *a) {b+=*a;return(b) ;} void main( ) { int a=2,res=2; res+=func(&a) ; cout<<res;}
A.4
B.6
C.8
D.10
第5题:
下列程序执行后的输出结果是( )。 #include<stdio.h> void func1(int i); void func2(int i); char st[]="hello,friend!"; void funcl(int i) { printf("%c",st[i]); if(i<3){i+=2;func 2(i);} } void func 2(int i) { printf("%c",st[i]); if(i<3){i+=2;funcl(i);} } main() { int i=0; funcl(i);printf("\n"); }
A.hello
B.hel
C.hlo
D.hlm
第6题:
有如下函数模板定义: template <class T> T func(T x, T y){return x*x*y*y;) 在下列对func的调用中,错误的是
A.func(3,5);
B.func(3.0,5.5);
C.func(3,5.5);
D.func<int>(3,5.5);
第7题:
下面代码有何错误
void func1()
{
int *pa = NULL;
func2(pa);
delete pa;
}
void func2(int *pb)
{
pb = new int(5);
}
第8题:
int func1(int& b)
{
return 0;
}
void func2()
{
int bbb = 3;
func1(&bbb);
func1(bbb);
}
func2中有何错误,func1的参数b 的类型是什么。
第9题:
有如下函数模板的定义: template<class T> T func(T x,T y){return x*x+y*y;} 在下列对func()的调用中,不正确的是( )。
A.func(3,5);
B.func<>(3,5);
C.func(3,5.5);
D.func<int>(3,5.5);
第10题:
下列表示纯虚函数的成员函数是
A.virtual int func(int);
B.void func(int)=0;
C.virtual void func=0;
D.virtual void func(int){}
第11题:
有如下函数模板的定义: template<class T> T func(T x,T y){return x*x+y*y;} 在下列对func的调用中不正确的是
A.func(3,5);
B.func<>(3,5);
C.func(3,5.5);
D.func<int>(3,5.5);
第12题:
Func(ref(10*a))
Func(ref 10)
Func(ref(a) )
Func(ref a)
第13题:
A. func f(a, b int) (value int, err error)
B. func f(a int, b int) (value int, err error)
C. func f(a, b int) (value int, error)
D. func f(a int, b int) (int, int, error)
第14题:
在C程序中有如下语句:char *func(intx,int y); 它是( )。
A.对函数func的定义。
B.对函数func的调用。
C.对函数func的原型说明。
D.不合法的
第15题:
有如下函数模板定义: template<class t> T func(Tx,Ty){return x*x+y*y;} 在下列对func的调用中,错误的是
A.func(3,5);
B.func(3.0,5.5);
C.func(3,5.5);
D.func<int>(3,5.5)
第16题:
下列表示纯虚函数的成员函数是
A.virtual int func (int);
B.void func(int)=0;
C.virtual void func=0;
D.virtual void flmc(int){}
第17题:
下面程序执行后的结果是( )。 #include<iostream> using namespace std; void func1(int i); void func2(int i); char st[]="hello, friend!"; void func1(int i) { cout<<st[i]; if(i<3){i+=2;func2(i);} } void func2(int i) { cout<<st[i]; if(i<3){i+=2;func1(i);} } void main() { int i=0;func1(i);cout<<endl;}
A.ello
B.hel
C.hlo
D.him
第18题:
下列程序执行后的输出结果是( )。 void func1 (int i); void func2(int i); char st[]="hello,friend!"; void func1 (int i) { printf("%c",st[i]); if(i<3){i+=2;func2(i);} } void func2(int i) { printf("%c",st[i]); if(i<3){i+=2;func1(i);}
A.hello
B.hel
C.hol
D.hlm
第19题:
下面代码有何错误
void func2(int *value)
{
*value = 2;
}
void func1()
{
int *p = 0;
func2(p);
}
第20题:
有下列程序void func1(int i);void func2(int i);char st[ ]="hello,friend! ";void func1(int i){ printf("%c",st[i]); if(i<3){i+=2;func2(i);}}void func2(int i){ printf("%c",st[i]); if(i<3){i+=2;func1(i);}}main(){ int i=0;func1(i); printf("\n");}执行后的输出结果是A.hello B.helC.hlo D.hlm
第21题:
类class one 在声明func 成员函数时发生错误,出错原因是【 】。
Class one
{
private:
int a;
public:
void func(two& )
};
class two
{
private:
int b;
friend void one: :func(two & );
};
void one: : func(two& r)
a=r.b;
}
第22题:
下面程序的运行结果是 #include<iostream.h> void main() { int num=1; int &ref=num; ref=ref+2; cout<<num; num=num+3; cout<<ref<<end1; }
A.13
B.16
C.36
D.33
第23题: