B
Bern
The following is C code:
typedef struct __Haha Haha, *PHaha;
struct __Haha {
int i;
};
void main(){
Haha haha;
haha.i = 123;
PHaha phaha = & haha; // <<<<< error line
phaha->i = 234;
}
---------------------------------------------
i compiled the code above in C using MS compiler and it
generates an error in the line indicated.
The error is "illegal use of this type as an expression".
Yet when i compiled it as C++ code, everything is alright.
So whats the problem?
typedef struct __Haha Haha, *PHaha;
struct __Haha {
int i;
};
void main(){
Haha haha;
haha.i = 123;
PHaha phaha = & haha; // <<<<< error line
phaha->i = 234;
}
---------------------------------------------
i compiled the code above in C using MS compiler and it
generates an error in the line indicated.
The error is "illegal use of this type as an expression".
Yet when i compiled it as C++ code, everything is alright.
So whats the problem?