1.C/C++中求得数据长度并遍历
double c[12] = {'a','b','c','d','e','f','g','h','i','j','k','l'};
//totallong(96) = sizeof(c)求得数组长度 但由于本长度与类型有关所以 typelong(8) sizeof(*c)求得类型长度
//所以数组长度为size = totallong / typelong
//size = sizeof(c)/sizeof(*c);
int size = sizeof(c)/sizeof(*c);
for (int i = 0; i < size; i++) {
cout << c[i] << endl;
}