第四章 复合类型复习题

第四章 复合类型复习题

1.

a

char actor[30];

b

short betsie[100];

c

float chuck[13];

d

long double dipsea[64];

2.

int num[5] = {1, 3, 5, 7, 9};

3.

int even = num[0] + num[4];

4.

cout << ideas[1];

5.

char str[20] = “cheeseburger”;

6.

struct Fish
{
	char kind[20];
	int gram;
	double inch;
};

7.

Fish fish = {"liyu", 64, 1.3};

8.

enum Response= {Yes = 1, No = 0, Maybe = 2};

9.

double *p = ted; 

10.

float *p = treacle;
cout << *p << *(p+9);

11.

cout << "请输入一个正整数:\n";
int num;
cin >> num;
int *nums = new int [num];

12.

有效。将打印出字符串的首地址

13.

Fish *fish = new Fish;
cout <<  fish->kind << fish->gram << fish->inch;
发布了42 篇原创文章 · 获赞 1 · 访问量 1603

猜你喜欢

转载自blog.csdn.net/qq_32631105/article/details/104110327