浙商银行2011.11.26校园招聘会笔试题

1、下列4行代码是否有错误,若有错误请指出,若没有,请确定a的值是多少?

int a = 3; a += (a++); a += (++a); (++a) += (a++); (a++) += a;

2、下面代码的输出是多少?

int main(void) { FILE *fp; char str[100]; fp=fopen("myfile.dat","w"); fputs("abc",fp); fclose(fp); fp=fopen("myfile.data","a++"); fprintf(fp,"%d",28); rewind(fp); fscanf(fp,"%s",str); puts(str); fclose(fp); return 0; }

3、下面代码的输出是(B

class Myclass { public: Myclass(int n) { number = n;} Myclass(Myclass &other) { number = other.number; cout<<"a "; } private: int number; }; Myclass fun(Myclass p) { Myclass temp(p); return temp; } int main(void) { Myclass obj1(10),obj2(0); Myclass obj3(obj1); obj2=fun(obj3); return 0; }

A、a a a B、a a a a C、a a D、a

定义对象obj3的时候,调用了对象赋值函数,输出了a,调用函数fun的时候,先调用对象赋值函数把对象obj3赋值给了p,然后又一次调用对象赋值函数赋值给了temp对象,最后把函数返回值又赋值给了对象obj2,共调用了4次,所以输出了4个a。

4、下面代码的输出是(A

class Myclass { public: Myclass(int n) { number = n;} Myclass(Myclass &other) { number = other.number; cout<<"a "; } private: int number; }; Myclass fun(Myclass &p) { Myclass temp(p); return temp; } int main(void) { Myclass obj1(10),obj2(0); Myclass obj3(obj1); obj2=fun(obj3); return 0; }

A、a a a B、a a a a C、a a D、a

由于函数fun的是传引用参数,没有进行对象的赋值,只是在函数内部进行了一次对象之间的赋值,所以比上一题少了一次调用,所以就输出了3个a。

5、下面错误的是()

A、define N 10;

int x[N];

B、int N = 10;
int x[N];

C、int x[0..10];

D、int x[];
简答题:

1、abstract class 和interface的区别?

2、数据库中索引的作用的什么?什么情况下适合建立索引及什么情况下不适合建立索引?

3、黑盒测试和白盒测试的优缺点各是什么?


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值