#include "stdafx.h"
using namespace std;
struct buf
{
int kobe[5];
int i;
char b;
};
int _tmain(int argc, _TCHAR* argv[])
{
buf buf1;
buf1.b = 'b';
buf1.i = 10;
srand( time(NULL));
for( int i = 0 ; i < 5 ; i++ )
{
buf1.kobe[i] = rand()%20;
}
for( int i = 0 ; i < 5 ; i++ )
{
cout << buf1.kobe[i] << " ";
}
cout << "这里是重点!" << endl;
cout << sizeof(((buf*)(0))->kobe)/sizeof(int);
cout << endl;
return 0;
}
红色部分是重点内容,刚学会的,非常好,/(^o^)/~,特发表文章来等待宝宝归来