int main(int argc, int *argv[])

This is a discussion on int main(int argc, int *argv[]) within the C Programming forums, part of the General Programming Boards category; Hi guys, Is it acceptable to change the varibale name in int main(int argc, int *argv[]) to something like: int ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    84

    int main(int argc, int *argv[])

    Hi guys,

    Is it acceptable to change the varibale name in
    int main(int argc, int *argv[])

    to something like:
    int main(int mycount, int *myargv[])

    or I MUST use argc, argv??

    Thank you

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    The variable names are completely up to you, within the normal restrictions for C variable names.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    84
    Thank you!!

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    Why do you want to use nonstandard names for these variables? It will probably cause confusion.

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    84
    I don't.
    I just wanted to know if it's possible and portable.

  6. #6
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,305
    That last argument should be a char*[] not an int*[]
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. NEED HELP READING FILE and PRINTING
    By geoffr0 in forum C Programming
    Replies: 4
    Last Post: 04-16-2009, 05:26 PM
  2. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 08:36 PM
  3. Drawing Program
    By Max_Payne in forum C++ Programming
    Replies: 21
    Last Post: 12-21-2007, 04:34 PM
  4. Working with random like dice
    By SebastionV3 in forum C++ Programming
    Replies: 10
    Last Post: 05-26-2006, 09:16 PM
  5. How do you search & sort an array?
    By sketchit in forum C Programming
    Replies: 30
    Last Post: 11-03-2001, 04:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21