Okay, I have this program that im making that's a login program. It uses classes, functions and everything, but what's giving me problems right now is a simple integer in the int main() section.
Basically, I declare an int (doesnt matter if i declare it as an int or const int...same thing happens) and set it to a value. A few lines later I tell it to cout that value...and it outputs a different value than it should.
declaration:
Code:
int pass = 01103657;//'secret' password
cout:
Here's the troublesome section of code:
Code:
//Main Function
int main()
{
//Variable declaration
int choice, count = 0, i;
int idnum, pwd;
int pass = 01103657;//'secret' password
//pass=01103657;
char firstname[26];
char lastname[26];
//Pointer to new data structure in class
Students *stdnt = new Students[100];//Students not logged in
//Students *stdnt2 = new Students[100];//Student logged in
do//Infinite(for now) Menu Loop
{
//Main Menu
system("cls");//Clear screen
cout << "**** MCC COMPUTER LAB LOGON ****\n";
cout << " !!!PLEASE LOGIN!!! \n\n";
cout << "Please choose:\n";
cout << "1. Login\n";
cout << "2. Logout\n";
cout << "3. New Student\n";
cout << "Pleas note that you are a New Student if\n"
<< "this is your first time here this semester!!\n\n";
cout << pass;
cin >> choice;//Enters menu choice
When I run the program, the cout gives me '296879' instead of '01103657'.
I can post the whole program if need be.