I'd like to start by letting everyone know that I've been programming (or trying, at least) for only a couple weeks, therefore I know very little about vocabulary so please provide a definition for programming-specific words. I am currently reading the Beginner Tutorial guide on this website, also a few C++ books.
Alright, I only made it to the second section, If Statements, and I'm trying to make a quiz-like program. So here is my code:
Code:
#include <iostream>
using namespace std;
int main()
{
char A, B, C, D;
cout<<"What year was WWII thought to be started? ";
cout<<"A. 1931";
cout<<"B. 1945";
cout<<"C. 1939";
cout<<"D. 1967";
char>> A;
char>> B;
char>> C;
char>> D;
cin.ignore();
if (int = A){
cout<<"1931 is incorrect. C was the right answer.";
}
if (int = B){
cout<<"1945 is incorrect. C was the right answer.";
}
if (int = C){
cout<<"1939 is correct. Good job!";
}
if (int = D){
cout<<"1967 is incorrect. C was the right answer.";
}
cin.get();
}
Can somebody tell me where I went wrong? Now I'm not asking anybody to do this for me, but just give me a few hints on where I messed up. For the record, I'm using Dev-C++ 4.9.9.2