Jan 30, 2013 at 1:16am UTC
I am messing around with C++ and doing a ridiculously simple IO program, when I encountered an error. Here is the program
#include <iostream>
using namespace std;
int main()
{
char letter;
cout << "What's your favorite letter?" << endl;
cin >> letter;
cout << letter; "is your favorite letter." << endl;
return 0;
}
I try to compile using Code::Blocks when I receive this error
invalid operands of types 'const char [25]' and '<unresolved overloaded function type>' to binary 'operator<<'|
Jan 30, 2013 at 1:24am UTC
cout << letter; "is your favorite letter." << endl;
You have a semicolon after letter that is not supposed to be there.
Last edited on Jan 30, 2013 at 1:24am UTC
Jan 30, 2013 at 1:32am UTC
Ah, thanks for the help, I edited my previous post as I fixed the problem. I made letter its own line with a semi-colon and ran the program just fine. Thank you very much.
Last edited on Jan 30, 2013 at 1:35am UTC