一、不定项选择题
、以下程序的打印结果是()
[cpp] view plaincopyprint?
1. #include<iostream>
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. }
、
、
、
、
、以下程序打印的两个字符分别是(
)
[cpp] view plaincopyprint?
1. typedef struct object object;
2. struct object
3. {
4.
char data[3];
5. };
评论