指针付值
#include "iostream"int main()
{
int i=5;
int *P=0;
p = &i;
return 0;
}
--------------------Configuration: new - Win32 Debug--------------------
Compiling...
nwe.cpp
D:\Program Files\Microsoft VC\myfiles\new\nwe.cpp(6) : error C2065: 'p' : undeclared identifier
D:\Program Files\Microsoft VC\myfiles\new\nwe.cpp(6) : error C2440: '=' : cannot convert from 'int *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
执行 cl.exe 时出错.
nwe.obj - 1 error(s), 0 warning(s)
#include "iostream"
int main()
{
int i=5;
int *P=&i;
return 0;
}
nwe.obj - 0 error(s), 0 warning(s)