2

gcc C language forward declaration problem

view story
linux-howto

http://www.linuxquestions.org – this is strange .. i did use forward declaration in c++ but in c it is giving me an error ... for example: Code: #include <stdio.h> #include <string.h> typedef struct Student S; typedef struct Student{ char name[100]; }S; int main() { char c[100]; S s; strcpy(s.name,"yousaf"); printf("%s\n",s.name); return 1; } if i compile the above code using: Code: gcc test.c -o test it give me an error of redefinition but if i use Code: g++ -x c te (HowTos)