當(dāng)前位置:首頁(yè) > 嵌入式培訓(xùn) > 嵌入式招聘 > 嵌入式面試題 > C++面試題 嵌入式必考題---含答案
C++面試題 嵌入式必考題---含答案
時(shí)間:2016-10-08 來源:未知
1、你認(rèn)為可以完成編寫一個(gè)C語言編譯器的語言是()
A.匯編
B.C語言
C.:VB
D.以上全可以
2、在帶頭結(jié)點(diǎn)的雙向循環(huán)鏈表中插入一個(gè)新結(jié)點(diǎn),需要修改的指針域數(shù)量是()
A.2個(gè)
B.6個(gè)
C.3個(gè)
D.4個(gè)
3、以下程序的打印結(jié)果是()
1.#include
2.using namespace std;
3.
4.void swap_int(int a , int b)
5.{
6. int temp = a;
7. a = b;
8. b = temp;
9.}
10.
11.void swap_str(char*a , char*b)
12.{
13. char*temp = a;
14. a = b;
15. b = temp;
16.}
17.
18.int main(void)
19.{
20. int a = 10;
21. int b = 5;
22. char*str_a = "hello world";
23. char*str_b = "world hello";
24. swap_int(a , b);.
25. swap_str(str_a , str_b);
26. printf("%d %d %s %s\n",a,b,str_a,str_b);
27.
28. return 0;
29.}
A.10 5 hello world world hello
B.10 5 world hello hello world
C.5 10 hello world world hello
D.5 10 world hello hello world
4、下列代碼的輸出結(jié)果是_____
boolean b=true?false:true==true?false:true;
System.out.println(b);
A.true
B.false
C.null
D.空字符串
5、以下程序的輸出結(jié)果是?
int x = 1;
do{
printf("%2d\n",x++);
}while(x--);
A.1
B.無任何輸出
C.2
D.陷入死循環(huán)
6、假設(shè)以數(shù)組A[60]存放循環(huán)隊(duì)列的元素,其頭指針是front=47,當(dāng)前隊(duì)列有50個(gè)元素,則隊(duì)列的尾指針值為()
A.3
B.37
C.97
D.50
7、一個(gè)棧的入棧序列是a,b,c,d,e,f,則棧的不可能的輸出序列是()
A.fedcba
B.defbca
C.defcba
D.abcdef
8、下面模板聲明中,哪些是非法的()
A.templateclass C1{};
B.templateclass C2{};
C.templateclass C3{};
D.templateclass C4{};
參考答案:
1~5:DDABD 6~8:B B BD

