我寫了下面的程序:爲什麼這個C代碼編譯? C結構typdef
typedef struct blahblah {
int x;
int y;
} Coordinate;
int main() {
Coordinate p1;
p1.x = 1;
p1.y = 2;
//blah blah has not been declared as a struct, so why is it letting me do this?
struct blahblah p2;
p2.x = 5;
p2.y = 6;
}
任何人都可以向我解釋這是怎麼回事?
我不太明白。 'struct blahblah'當然*已經被聲明爲一個結構體,它就在你的例子的頂部。 – 2012-02-29 05:18:26