typedef 的菜鸟问题!!!!
如下:
struct Myclass
{
int i;
int j;
};
typedef struct Myclass* A,B;
typedef struct Myclass *A,B;
(注意空格的位置)
这两种形式有什么不同, 在什么情况下会有区别.
[解决办法]
#include <iostream>
using namespace std;
struct Myclass
{
int i;
int j;
};
typedef struct Myclass* A,B;
typedef struct Myclass *C,D;
int main()
{
A a;
B b;
C c;
D d;
a = c;
return 0;
}
用a=b;a=c;试试,编译器会告诉你什么是什么