[flydream@flydream C++]$ cat X.cpp
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
unsigned int const size1 = 2;
char str1[size1];
unsigned int temp;
cin >> temp;
const unsigned int size2 = temp;
char str2[size2];
return 0;
}
[flydream@flydream C++]$
[flydream@flydream C++]$ g++ -g -Wall X.cpp
X.cpp: In function ‘int main(int, char**)’:
X.cpp:7:6: warning: unused variable ‘str1’ [-Wunused-variable]
X.cpp:13:6: warning: unused variable ‘str2’ [-Wunused-variable]
[flydream@flydream C++]$
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
unsigned int const size1 = 2;
char str1[size1];
unsigned int temp;
cin >> temp;
const unsigned int size2 = temp;
char str2[size2];
return 0;
}
[flydream@flydream C++]$
[flydream@flydream C++]$ g++ -g -Wall X.cpp
X.cpp: In function ‘int main(int, char**)’:
X.cpp:7:6: warning: unused variable ‘str1’ [-Wunused-variable]
X.cpp:13:6: warning: unused variable ‘str2’ [-Wunused-variable]
[flydream@flydream C++]$
郁闷 这个在GCC上通过编译了
有些网友说的不能够通过编译