CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: about function

  1. #1
    Join Date
    Feb 2009
    Posts
    6

    about function

    how many arguments we can pass to a function i need it in number plaese any body help me out

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: about function

    Which function do you have in mind?
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Dec 2003
    Location
    Syracuse, NY
    Posts
    400

    Re: about function

    You have a lot of basic questions. I think you should go and look up some C++ tutorials online or get a beginner C++ book.
    "Windows programming is like going to the dentist: You know it's good for you, but no one likes doing it."
    - Andre LaMothe

    DLL For Beginners(UPDATED)
    Please use CODE tags
    Rate me if I've helped.

  4. #4
    Join Date
    Dec 2006
    Posts
    37

    Re: about function

    Hi munigantipardhu,

    how many arguments we can pass to a function i need it in number plaese any body help me out

    Actually there is no limit. You can pass as many as argument you want.

    Even in C and C++, you do not have to mention in the Signature of the function.

    Ex:

    Signature of function could be like this;

    int TestFunction ( int total_no_of_argument, ... )
    {
    //use the total_no_of_argument to iterate through all the arguments
    //for this you have to read va_start, va_list and va_arg macros
    }

    And can call the above function as;
    1. TestFunction (5, 1, 2, 3, 4, 5 );
    2. TestFunction (10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
    3. As many as argument you want

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured