delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/24/21:21:45

From: Vic <tudor AT cam DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: building exe's
Date: Sun, 24 Jan 1999 20:47:42 -0500
Organization: Communications Accessibles Montreal, Quebec Canada
Lines: 11
Message-ID: <36ABCD3E.62EF@cam.org>
References: <d68e3003 DOT 36ab9277 AT aol DOT com> <78gfdm$nvl$1 AT ultra DOT sonic DOT net>
NNTP-Posting-Host: dialup-420.hip.cam.org
Mime-Version: 1.0
X-Mailer: Mozilla 3.0Gold (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Ben Cluff wrote:
> All C++ programs need to have the function -- int main(), You cannot rename
> this and it also has to be the first.

Well, you CAN rename it, but there would be no point. And it doesn't
have to be the first. When you run your exe,the startup code will look
for a function called main and execute it (actually, it's a bit more
complicated since the linker checks for the main function and the
startup code already knows where it is but...)
you can put how many functions you want before, as long as youhave ONE
main function you will get an exe.

- Raw text -


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