a.char actors [30];
b.short betsie [100];
c.float chuck [13];
d.long double dipsea [64];
array< char,30> actors;
array<short 100> betsie;
array<float 13>chuck;
array<long double 64>;
3.int odd[5] = {1,3,5,7,9};
4.int even = odd[0] + odd[4];
5.cout << ideas[1] << endl;
6.char lunch[] = "cheeseburger";
7.string str1 = "Waldorf Salad";
8.sturct fish {
char species[];
int weight;
float lenght;
};
9.fish first =
{
"Nimo";
20;
22.22;
};
10.enum Response = {No,Yes,Maybe};
11.double *p = &ted;
12.float treacle[10];
float p = treacle;
或float p = &treacle[0];
cout<<p<<"and"<<(p+9);
int number;
cin >> number;
int *p = new array_number[number];
vector<int> array_namber(number);
14.有效,打印出字符串的地址;
15.fish *p = new fish;
cout <<ps->species<<endl;
16.address没有定义
const vecor<elephant>string(10);
const array<string,10> elephant;
#include <string>//包含头文件vector
#include<vector>
#include<array>
const int Str_num{10};//or = 10
...
std::vector<std::string>vstr(Str_num);
st::array<std::string,Str_num>astr;