delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/06/00:32:08

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: why want it run?
Date: 6 Feb 2002 05:28:02 GMT
Organization: Cornell University
Lines: 36
Sender: asu1 AT cornell DOT invalid (on pool-141-149-208-142.syr.east.verizon.net)
Message-ID: <Xns91AD4C18AE4Dasu1cornelledu@132.236.56.8>
References: <3C8483FA AT mail DOT pdq DOT net>
NNTP-Posting-Host: pool-141-149-208-142.syr.east.verizon.net
X-Trace: news01.cit.cornell.edu 1012973282 6842 141.149.208.142 (6 Feb 2002 05:28:02 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 6 Feb 2002 05:28:02 GMT
User-Agent: Xnews/L5
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019