Path: utzoo!attcan!uunet!seismo!dimacs.rutgers.edu!rutgers!sun-barr!cs.utexas.edu!samsung!usc!ucsd!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpcc05!hpcuhb!hpindda!hardin From: hardin@hpindda.cup.hp.com (John Hardin) Newsgroups: comp.lang.c++ Subject: Re: Can you prototype main() ????? Message-ID: <6170027@hpindda.cup.hp.com> Date: 22 Sep 90 00:09:45 GMT References: <24447@uflorida.cis.ufl.EDU> Organization: HP Information Networks, Cupertino, CA Lines: 33 > Hummm... This looks like yet another one of these little C incompatabilities > which didn't quite make it into the list of the incompatabilities in > chapter 18. > > My favorite one is illustrated by the following example: > > void foobar (int irritating) > { > int irritating; > } > > Put that in your C++ compiler! Then look for this in chapter 18. It ain't > there. > > // Ron Guilmette - C++ Entomologist ---------- Sorry, perhaps I'm just being dense today, but I don't get your point. When I put the above code through an ANSI C compiler I get "x.c", line 3: warning: redeclaration of 'irritating' hides formal parameter while I get the following when I put it through my C++ compiler: CC: "x.C", line 3: error 1031: two declarations of irritating Could you please clarify? Thanks. John Hardin hardin@hpindgh.hp.com -----------