+ 1
How do I fix the "too many arguments to function" error?
I just began to learn how functions work but can't understand very well the issue that I currently have with my code now. #include <iostream> using namespace std; int sumFunction(); int main () { cout << sumFunction(1); return 0; } int sumFunction(int a) { int y = a + 1; return (y); } I keep getting an error message saying "too many arguments to function 'int sumFunction () ' ."
1 Respuesta
+ 4
The prototype must have the same signature as the implementation.
int sumFunction();
-> int sumFunction(int);