Mail Archives: djgpp/2002/02/06/00:32:08
gecko1 <gecko1 AT pdq DOT net> wrote in news:3C8483FA AT mail DOT pdq DOT net:
> I have a compaq presario with 900mhz and windows ME. When I go to run
> a program i have created a message appears that says, Program exit
> code: -1 (0xffffffff). This is my third week of my computer science
> course and i know very little about c compiling. This message does
> not come up when i run the same program in my class. Any help would
> be great. Thanks!
please do consult the comp.lang.c.moderated faq and the newsgroup. these
kinds of posts are off-topic here. however, since I am already
responding to your post, I am guilty too ... why not go all the way:
the only two valid prototypes for main are:
int main(void);
and
int main(int argc, char *argv[]);
traditionally, returning 0, or EXIT_SUCCESS from main is used to
indicate successful completion of a program, whereas any other value
indicates some error.
my guess is you are failing to return a value from main, hence random
garbage is being returned. simply don't do that ... if you insist on
doing it, but up with the messages and other assorted potential
troubles.
#include <stdlib.h>
int main(void)
{
return EXIT_SUCCESS;
}
Sinan.
- Raw text -