#include <iostream.h>
struct test{
char x[1];
};
void main()
{
struct test x;
x.x[0]='c';
x.x[1]='d';
x.x[2]='e';
x.x[3]='\0';
cout<<x.x<<"\t"<<sizeof(struct test)<<endl;
}
结果
cde 1
Press any key to continue
说明:C++不执行越界检查