+ 1
Why wont this work?
This pequeno piece of code wont run coz I made "too many arguments to function 'int printSomething2()'". where did I go wrong? #include <iostream> using namespace std; void printSomething(); int printSomething2(); int main(){ printSomething(); cout << printSomething2(9.95); return 0; } void printSomething(){ cout << "Print this statement to the screen!\n"; } int printSomething2(float a){ a + 13; } https://code.sololearn.com/c92x8c7UxiLm/?ref=app
2 odpowiedzi
+ 3
In the prototype of printSomething2(), you declare it without a parameter. The function also doesn't return a value which may results undefined behavior.
+ 1
CarrieForie thanks, I never paid attention to declaration of the prototype...