delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/26/21:44:49

From: "Maan M. Hamze" <mmhamze AT mail DOT utexas DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: main() {...} (was: using rhide)
Date: 26 Jan 1997 23:52:14 GMT
Organization: University of Texas at Austin
Lines: 38
Message-ID: <01bc0be2$ea9b6c20$a3db5380@maan-m.-hamze>
References: <01bbf2bd$ec4f95c0$590520ce AT d-moran> <01bc0b1f$c48e8ee0$94b15380 AT maan-m DOT -hamze> <5cfriq$1ql AT news1 DOT panix DOT com>
NNTP-Posting-Host: slip-90-3.ots.utexas.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Michael R Weholt <awnbreel AT panix DOT com> wrote in article
<5cfriq$1ql AT news1 DOT panix DOT com>...
> 
>         Pardon the brief off-topic interlude but why is main() {...} a 
> problem?  

It does not conform with ANSI C.  that is all!
It is better to stick to such standards instead of having to learn them
again later.
Also, to me it is as easy as this:
functions much have a type and their arguments should have a type otherwise
they are declares as Void.
As far as I am concerned main is no different.

>If these books 
> and tutorials are leading me down the garden path, I'd like to know 
> about it.  

To me it is a matter of laziness..I do not know.  Not one book I read on
C++, for example, ever bothered
to inform me that I should type cast something into (void *) in order to
get its address even when I am dealing with pointers.
Books, maybe due to different compilers, do their best to cater to some
denominator or it is just bad teaching habit.
It was on this newsgroup that I knew about (void *) for example.  I knew
also that this cast is the canonical form.
Other books did not even mention that and my compiler was always giving me
errors.
Learning C/C++ ia a matter of getting in touch with different sources. 
This newsgroup is one of them and it is easily the most interesting
and helpful
of them.
Maan
-- 
Maan M. Hamze
mmhamze AT mail DOT utexas DOT edu
http://leb.net/~mmhamze

- Raw text -


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