| | |
too many arguments to function error message.
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2007
Posts: 3
Reputation:
Solved Threads: 0
hello everyone I am trying to create an array that will prompt the user for 5 numbers in the array and simply display them. but I keep geting this error message saying i have too many arguments in my function... please help. here is my code:
c Syntax (Toggle Plain Text)
#include <iostream> using namespace std; void readList(int nums [], int size); void printList( int list[1000]); int main() { int theList[1000]; readList (theList, 5); printList (theList, 5); return 0; } void printList( int list[1000]) { int i; for(i = 0; i < 1000; i++) cout << list[i] << endl; } void readList(int nums [], int size) { int i; for(i=0; i < 5; i++) cout << "Enter the " << i + 1 << " number"; cin >> nums[i]; }
Last edited by WaltP; Apr 1st, 2007 at 8:11 pm. Reason: Added CODE tags -- read the words on the background of the post input box
> void readList(int nums [], int size);
> void printList( int list[1000]);
Notice what's different ?
The 1000 isn't actually doing anything useful (nor is it actually harmful either). It certainly has nothing to do with the size of the array being passed.
Also, read the intro threads and how to use [code][/code] tags.
> void printList( int list[1000]);
Notice what's different ?
The 1000 isn't actually doing anything useful (nor is it actually harmful either). It certainly has nothing to do with the size of the array being passed.
Also, read the intro threads and how to use [code][/code] tags.
•
•
Join Date: Apr 2007
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
> void readList(int nums [], int size);
> void printList( int list[1000]);
Notice what's different ?
The 1000 isn't actually doing anything useful (nor is it actually harmful either). It certainly has nothing to do with the size of the array being passed.
Also, read the intro threads and how to use tags.
![]() |
Similar Threads
- error: too many arguments to function `mysql_query' (C)
- error message with sessions (PHP)
- Function Error Message Help (C++)
- Help with error message (C++)
- Error message when trying to compute using sqrt (C++)
- Error message help? (C++)
Other Threads in the C++ Forum
- Previous Thread: C++ .NET random number not getting any output
- Next Thread: prtnt to printer
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






