From: Matthew H. G. <mge...@li...> - 2000-11-28 02:02:53
|
I believe with regular C, you must declare local variables at the top of the function. C++ allows you to declare them anywhere. Try compiling with "g++" Matthew Des wrote: > I've recently switched to MingW32 from DJGPP, and am having a strange > problem. The following hello program works fine: > > #include <stdio.h> > > int main() > { > printf("hello!"); > return 0; > } > > I build this by using the following command line: > > gcc hello.c -o hello.exe > > However, any attempt to initialise variables after the call to printf() > results in a parse error! For example: > > #include <stdio.h> > > int main() > { > printf("hello!"); > int c; > return 0; > } > > generates the error: > > clever.c: In function `main': > clever.c:5: parse error before `int' > > Anyone know any reason why this could be? Initialising variables prior to > the printf() call works fine, but for some reason not subsequent to it. Any > help would be appreciated. > > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options at: > http://lists.sourceforge.net/mailman/listinfo/mingw-users |