Message-ID: <37D1DFFA.1E834ACA@unb.ca> From: Endlisnis X-Mailer: Mozilla 4.61 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: problems compiling c++ in rhide References: <7qjmhn$o47$1 AT nickel DOT uunet DOT be> <37D0B102 DOT 389529B AT earthlink DOT net> <7qrfmq$qvq$1 AT solomon DOT cs DOT rose-hulman DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 29 Date: Sun, 05 Sep 1999 03:46:01 GMT NNTP-Posting-Host: 198.164.188.197 X-Trace: news21.bellglobal.com 936503161 198.164.188.197 (Sat, 04 Sep 1999 23:46:01 EDT) NNTP-Posting-Date: Sat, 04 Sep 1999 23:46:01 EDT Organization: Sympatico To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Damian Yerrick wrote: > > > #include > > > void main (){ > > > cout << "Hello World"; > > > } > > > What did I do wrong? > > In addition to using an illegal return type for main(), it appears > Illegal return type? Some C/C++ programming books encourage > a fellow to make main() a procedure. But maybe that's because I > came from a Macintosh background, and this is DOS. I don't think the word "procedure" is correct for C/C++. That's what they call functions that don't return values in Basic/Pascal, but if something in C has a 'void' return type, it is still a function, but that's just being picky. If the books encourage you to use 'void' as a return type for main, then the books are wrong. The ANSI C/C++ standard requires that the main function return 'int', under all platforms including Mac's. I used to use "void main()" a lot in Borland C, and it didn't mind it, but it was still wrong. -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT HotMail DOT com ICQ: 32959047