0

What's wrong with this?

#include <iostream> using namespace std; int main() { cout << "This " << "is " << "awesome!"; return 0; patch() fer<< "is " << "good "; return 1; }

21st Dec 2016, 9:16 PM
Perroquet Charles
Perroquet Charles - avatar
2 Antworten
+ 2
Hello Perroquet Charles, In your code I see the folowing things: - the first one is that patch() has a missing prototype before main, assuming that you have void patch(){//code} after main; - second thing is that you are missing ; when calling patch(); - the third one is that instead of "fer" you would have to use cout to print. The return 0; as in no error occured should be at the end of main function. Naturally, a different number than 0 means that main() existed with an error. If you want to use those two returns, try to use a condition (if(){} else for example) to separate them, otherwise your function will exit with 0 after the first cout and the rest of the code will be ignored. Hope this helps you. Have a nice day. Ovidiu-Gabriel.
21st Dec 2016, 9:57 PM
Ovidiu-Gabriel
Ovidiu-Gabriel - avatar
0
thanks Stan
21st Dec 2016, 10:00 PM
Perroquet Charles
Perroquet Charles - avatar