Re: [Dev-C++] Question using "main" as a variable name
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: DC A <ad...@ho...> - 2008-04-07 19:22:30
|
> Amy...@ao... wrote:
> The only other way I can discribe it is the C++ standard insitsts, than you should never explicitly call main() from within a function. Main is a the main entry point to a program and the first called by the operating system
> when you execute the program.
>
> #include
>
> int main()
> {
> std::cout << "I am main\n";
>
> main(); // allowed, but not recomended
>
> return 0;
> }
>
> In general, using main as a function or variable is "protentially dangerous". The compiler will not flag
> as it an error, but more up to date ones my catch it as an error.
Now I understand it. Thanks for the help.
_________________________________________________________________
Turn every day into $1000. Learn more at SignInAndWIN.ca
http://g.msn.ca/ca55/213
|