Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uakari.primate.wisc.edu!uflorida!swamp.cis.ufl.edu!bp From: bp@swamp.cis.ufl.edu (Brian Pane) Newsgroups: comp.lang.c++ Subject: Re: Can you prototype main() ????? Message-ID: <24447@uflorida.cis.ufl.EDU> Date: 16 Sep 90 17:56:10 GMT References: <14227.26dc5b2f@max.u.washington.edu> Sender: news@uflorida.cis.ufl.EDU Reply-To: bp@swamp.cis.ufl.edu (Brian Pane) Organization: U of Florida. Computer Science Dept. Lines: 31 In article <14227.26dc5b2f@max.u.washington.edu>, 8324155@max.u.washington.edu writes: |> |> |> |> I'm hoping someone can help me with this (hopefully) easy question |> about C++, and specifically Turbo C++. I have been learning C++ and using |> the book "C++ Techniques and Applications" by Scott Robert Ladd, and when |> I tried to compile one of his example programs with Turbo C++ I got a |> "cannot overload 'main'" error message. It seems the compiler choked on |> the author prototyping main (with the line: int main(); |> Is this a problem with Turbo C++, or is it not allowed in C++ and the |> compiler that the author used just accepted it ? It works fine in Turbo |> if I remove the prototype. |> |> Thanks ahead of time, Mark Frey Actually, main is "int main (int, char**)." If you declare main without argc or argv, the compiler realizes that you must be talking about some *other* main. Perhaps the author was using a machine without an operating system? :-) -Brian Pane ------------------------------------------------------------------------- Brian Pane University of Florida Department of Computer Science bp@swamp.cis.ufl.edu Class of 1991 "If you can keep your expectations |#ifdef OFFENDED_ANYONE tiny, you'll go through life |# include "disclaimer.h" without being so whiny" - Matt Groening |#endif -------------------------------------------------------------------------