Menu

argc and argv to refer to function parameters

2002-11-24
2012-09-26
  • Nobody/Anonymous

    argc and argv will only refer to the parameters used on command line or it can refer to the parameters send to any functions?

    For example:

    ...
    TheFunction (warn, read, warnAgain, outPut, ask, write);
    ---

    Can i say argc=7 and argv[0]=TheFunction, argv[1]=warn, argv[2]=read, etc?

     
    • apj

      apj - 2002-11-24

      no.
      If you want to use variable numbers of arguments have a look into the <stdarg.h> header and the "..." operator.

      //Adam

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.