|
|
我的程序在不定义指针的情况下运行是正常的
在加入了下面代码后就不行了
Me c;//Me是Shengwu类的子类
Shengwu p;
p=&c;
编译器说
error C2501: 'act' : missing storage-class or type specifiers
error C2040: 'act' : 'int' differs in levels of indirection from 'class Me *'
error C2440: 'initializing' : cannot convert from 'class Shengwu *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
换成
int c;
int *p;
p=&c;
error C2501: 'p' : missing storage-class or type specifiers
error C2040: 'p' : 'int' differs in levels of indirection from 'int *'
error C2440: 'initializing' : cannot convert from 'int *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
也不行。
大家帮忙看看是怎么回事啊!
急死了~~~~~~ [em7] |
|