how to solve too many arguments in function call ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freedom19941
    New Member
    • Aug 2014
    • 4

    how to solve too many arguments in function call ?

    Here is my program.If got any error ,can you fix it?Thank you.
    Attached Files
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Compiling your code gives next error:
    Code:
    program.cpp: In function ‘int main()’:
    program.cpp:77:32: error: too many arguments to function ‘void list()’
    program.cpp:18:6: note: declared here
    make: *** [program] Error 1
    The error seems to be at line 77:
    Code:
    			case 1: list(products, index);
    related, line 18:
    Code:
    void list();

    Comment

    • freedom19941
      New Member
      • Aug 2014
      • 4

      #3
      How to fix it?I really don't know how to fix it

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        You have:

        Code:
        void list();
        and then you have:

        Code:
         list(products, index);
        Now either the list functions has no arguments or it has two arguments. If I has no arguments, then you can't use arguments. If it has two arguments, then you can't advertise it as having no arguments.

        Comment

        • freedom19941
          New Member
          • Aug 2014
          • 4

          #5
          problem fixed.Thank you.

          Comment

          Working...