|
-
Nov 7th, 2002, 01:56 PM
#1
Thread Starter
Lively Member
Using MAIN
How many times can I use MAIN in my C++ program?
Can I declare it as a variable and use it?
As main() is only one time allowed...
-
Nov 7th, 2002, 02:01 PM
#2
Monday Morning Lunatic
You can use MAIN if you want, since it's not main (case-sensitive).
Why, though? Also, most coding conventions have anything in ALL CAPITALS as either a preprocessor macro, or a constant of some kind.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 7th, 2002, 02:17 PM
#3
Thread Starter
Lively Member
Questions..
Its one of the questions my brother gets at some exam tomorrow...
-
Nov 7th, 2002, 02:23 PM
#4
Monday Morning Lunatic
Well, you can use MAIN as a function, variable, whatever, if you wanted. You could still only use that name once though (within the same namespace).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|