a. char actor[30];
b. short betsie[100];
c. float chuck[13];
d. long double dipsea[64];
#include <array>
a. array<char, 30> actor;
b. array<short, 100> betsie;
c. array<float, 13> chuck;
d. array<long double, 64> dipsea;
int arr[5] = {1,3,5,7,9};
int even = arr[0] + arr[4];
cout << ideas[1];
char str[] = "cheeseburger";
string str = "WaldorfSalad";
struct Fish{
string cat;
int weight;
double length;
};
Fish fish = {"草鱼", 10, 10.45}
- 枚举类型没做
double* p = &ted;
cout << *p;
float* p = treacle;
cout << "第一个" << p[0] << "最后一个" << p[9];
int num;
cin >> num;
int *arr = new int[num];
vector<int> arr(num);
有效:打印字符串的首地址
15.
Fish *fish = new Fish;
cout << fish->cat << fish->weight << fish->length;
16. 一旦遇到空白字符就结束
17.
#include <iostream>
#include <vector>
#include <array>
#include <string>
int main()
{
const int arrnums = 10;
const int vectornums = 10;
std::vector<std::string> vect(arrnums);
std::array<std::string, vectornums> arr;
}