z@z:~$ g++ -std=c++11 ref.cpp
ref.cpp:7:10: error: invalid conversion from ‘int’ to ‘int*’ [-fpermissive]
int *a = i;
^
z@z:~$ g++ -std=c++11 ref.cpp
int i = ;
//同类型才可以赋值
int *a = &i; int main()
{
cout << i << endl;
return ;
}
z@z:~$ g++ -std=c++11 ref.cpp
ref.cpp:7:10: error: invalid conversion from ‘int’ to ‘int*’ [-fpermissive]
int *a = i;
^
z@z:~$ g++ -std=c++11 ref.cpp
int i = ;
//同类型才可以赋值
int *a = &i; int main()
{
cout << i << endl;
return ;
}