I'm extremely new to C++ (I only started the course on it about 3 weeks ago) and I don't understand why this small program I'm trying to execute won't run. Here's the code
#include <iostream>
using namespace std;
int main()
{
int A;
int Y;
A = 5;
Y = 1;
cout << Y = ++A << endl;
return 0;
}
Note: I've tried writing it outside the block and I get back the error "invalid operands of types 'int' and '' to binary operator<<'. I've also tried declaring and initializing it in the same line and the same result. I'm really lost I've experimented for the last hour and no breakthroughs.