Or it seems odd to me.
Here is the prototype of the function in question:
here is the definition:Code:void getNumber(int &i);
And here are the errors:Code:void getNumber(int &ri) { char a[256]; char *p; int isNum; int isSize; cout << endl << "Enter the NUMBER: "; cin.get(a,256); cin.ignore(80, '\n'); isNum = checkNumeric(a); if(isNum == 1) { p = &a[0]; ri = atoi(p); isSize = checkSize(ri); if(isSize != 1) { ri = getNumber(); } } if(isNum == 0) { ri = getNumber(); } }
I'm quite rusty on references, but comparing my code to example code, I can't quite seem whats causing it. What could it be?Code:asef.cpp: In function `void getNumber(int&)': asef.cpp:85: too few arguments to function `void getNumber(int&)' asef.cpp:102: at this point in file asef.cpp:102: void value not ignored as it ought to be asef.cpp:85: too few arguments to function `void getNumber(int&)' asef.cpp:107: at this point in file asef.cpp:107: void value not ignored as it ought to be
P.S. -> checkNumeric checks to see if the user enter a number. If he/she/it didn't, it returns 0, if he does, it returns 1. checkSize makes sure the user doesn't enter a number too large for the int to handle - returns 0 if it is too big, 1 if it isn't.



LinkBack URL
About LinkBacks



Have a nice day.