Thread: ** in main()

  1. #1
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563

    ** in main()

    Hi all~

    I am stick why something like **a or *a[] is permitted in main's argument list while isnt allowed for common functions?
    Never end on learning~

  2. #2
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Sure it is...


    Code:
    int myMain(int argcount, char *arguments[])
    {
       cout << argcount;
       return 0;
    }
    
    int main(int argc, char *argv[])
    {
       return myMain(argc, argv);
    }

  3. #3
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563
    Originally posted by Eibro
    Sure it is...


    Code:
    int myMain(int argcount, char *arguments[])
    {
       cout << argcount;
       return 0;
    }
    
    int main(int argc, char *argv[])
    {
       return myMain(argc, argv);
    }
    I know that but why ???
    Never end on learning~

  4. #4
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    I have one question: What is the use of there arguments, can you give me any ideas?

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Long story short it is the standard c entry point into a program. Main can take no arguments or an array of strings with a counter that dictates the size of that array.

  6. #6
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    i'm confused as to what you're asking. I could write a function prototype such as
    Code:
    char ***myfunction (void * (*func)(int ***ptr, char **array[]), long *****ptr);
    and it will be 100% legal C++ (i'd hate to see the code for this function, though). what are you asking?
    hello, internet!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why To Use int main()
    By year2038bug in forum C Programming
    Replies: 2
    Last Post: 08-19-2005, 01:28 PM
  2. passing params to main()
    By mike11 in forum C++ Programming
    Replies: 14
    Last Post: 06-21-2005, 12:36 PM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  4. Int Main or Void Main?
    By FromHolland in forum C++ Programming
    Replies: 9
    Last Post: 06-12-2003, 04:29 PM
  5. int main (), main (), main (void), int main (void) HELP!!!
    By SmokingMonkey in forum C++ Programming
    Replies: 7
    Last Post: 05-31-2003, 09:46 PM