Overloaded

Discussion in 'C++' started by Ben Pope, Dec 10, 2005.

  1. Ben Pope

    Ben Pope Guest

    Nagaraj wrote:
    > Can we overload main() function?


    What would you expect to happen?

    How would expect to choose which overload?

    Ben Pope
    --
    I'm not just a number. To many, I'm known as a string...
     
    Ben Pope, Dec 10, 2005
    #1
    1. Advertisements

  2. Ben Pope

    Nagaraj Guest

    Can we overload main() function?
    Nagaraj
     
    Nagaraj, Dec 10, 2005
    #2
    1. Advertisements

  3. Nagaraj wrote:
    > Can we overload main() function?


    3.6.1p2
    "An implementation shall not predefine the main function. This function
    shall not be overloaded. It shall have a return type of type int, but
    otherwise its type is implementation defined."

    3.6.1p3
    "The function main shall not be used (3.2) within a program. The
    linkage (3.5) of main is
    implementation defined. A program that declares main to be inline or
    static is illformed.
    The name 'main' is not otherwise reserved"
     
    Neelesh Bodas, Dec 10, 2005
    #3
  4. Ben Pope

    Chris Theis Guest

    "Nagaraj" <> wrote in message
    news:...
    > Can we overload main() function?
    > Nagaraj
    >


    No, and why in the whole world would you want to do that?

    Chris
     
    Chris Theis, Dec 10, 2005
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chuck Roth
    Replies:
    2
    Views:
    1,455
    Mike Treseler
    Sep 10, 2005
  2. Leszek Dubiel
    Replies:
    3
    Views:
    10,644
  3. Blue Streak
    Replies:
    1
    Views:
    378
    Bruce Barker
    Dec 14, 2005
  4. Replies:
    17
    Views:
    1,900
    Chris Riesbeck
    Nov 3, 2003
  5. Michael Borgwardt

    Generics: how to avoid overloaded methods?

    Michael Borgwardt, Dec 2, 2004, in forum: Java
    Replies:
    5
    Views:
    453
    Michael Borgwardt
    Jan 5, 2005
  6. Oliver Brausch

    Overloaded Methods called with null

    Oliver Brausch, Dec 27, 2005, in forum: Java
    Replies:
    20
    Views:
    901
    John C. Bollinger
    Dec 30, 2005
  7. Iain
    Replies:
    9
    Views:
    1,620
  8. Nitin Bhardwaj
    Replies:
    8
    Views:
    1,946
    Andrey Tarasevich
    Jul 14, 2003
Loading...