unsigned int
const size1
= 2;
char str1[ size1 ];
unsigned int temp
= 0;
cin >> temp;
unsigned int
const size2
= temp;
char str2[ size2 ];
答:str2定义出错,size2非编译器期间常量,而数组定义要求长度必须为编译期常量。
unsigned int
const size1
= 2;
char str1[ size1 ];
unsigned int temp
= 0;
cin >> temp;
unsigned int
const size2
= temp;
char str2[ size2 ];
答:str2定义出错,size2非编译器期间常量,而数组定义要求长度必须为编译期常量。