浙商银行2011.11.26校园招聘会笔试题
1、下列4行代碼是否有錯誤,若有錯誤請指出,若沒有,請確定a的值是多少?
int main(void) {int a = 3;a += (a++);??????? //7a += (++a);??????? //8(++a) += (a++);??? //9(a++) += a;??????? //a++不是左值,是右值return 0; }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、const int N = 10;????? ? ? //這個是正確的
?int x[N];
D、int x[0..10];
E、int x[];
簡答題:
1、abstract class 和interface的區別?
2、數據庫中索引的作用的什么?什么情況下適合建立索引及什么情況下不適合建立索引?
3、黑盒測試和白盒測試的優缺點各是什么?
?
總結
以上是生活随笔為你收集整理的浙商银行2011.11.26校园招聘会笔试题的全部內容,希望文章能夠幫你解決所遇到的問題。