I'm new to C++, and am having some problems understanding why my integer year is coming out as -2. I did not set a value to it as far as i can tell.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int age;
string mystring;
mystring = "Did you enjoy the game?";
int day, month;
int year;
cout << year << "\n";
cout << "Game Over!" << endl;
cout << "You Lose!" << endl;
cout << mystring << endl;
cout << "What was the best part of the game? \n";
cout << "Was it the graphics? \n";
cout << "Please put in your age: ";
cin >> age;
cout << "The age you put in is: " << age << endl;
cout << "Please put in the day (1-31) and the month (1-12) in thier numerical values: " << endl;
cin >> day >> month;
cout << "So today is " << month << "/" << day;
system("Pause");
}
Everything is working fine. Thanks for everything guys. I thought it would go automatically to 0 if it had no value, but now i see that it does not. Thanks again.