I'm required to work with multiple classes in one .cpp
file. I'm not sure what I'm doing wrong, is there a header file I need to include?
These are the errors I'm getting:
error C3646: 'loginObject': unknown override specifier
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2065: 'loginObject': undeclared identifier
#include <iostream>
#include <string>
using namespace std;
//Declaration of Class that Allows User to Select a Menu Option
class Menu
{
private:
int userChoice = 0; //User's Menu Selection
//Class Objects
Login loginObject;
public:
void options()
{
//Loop of Initial Menu
do
{
//Startup Menu
cout << "\n\tMain Menu:"
"\n\n\t1. Login"
"\n\t2. Create Password"
"\n\t3. Change Password"
"\n\t4. Delete User"
"\n\t5. Exit"
"\n\nSelection: ";
cin >> userChoice;
cout << endl;
//Switch Statement that Determines Course of Action based upon User's Choice
switch (userChoice)
{
case 1:
loginObject.login(); //Option to Login
break;
case 2:
cout << "\nCreating Password..."; //Option to Create a New Password
cout << endl;
break;
case 3:
cout << "Changing Password..."; //Option to Change an Old Password
cout << endl;
break;
case 4:
cout << "Deleting User..."; //Option to Delete a User
cout << endl;
break;
case 5:
cout << "Exiting..."; //Option to Exit the Program
cout << endl << endl;
system("pause");
default:
cout << "INVALID MENU OPTION!\n";
break;
}
} while (userChoice != 5); //Loop to Return to Initial Menu
}
};
//Declaration of Class that Manages all Activities Dealing with Login
class Login
{
private:
public:
void login()
{
cout << "\nLogging In...";
cout << endl;
}
};
//Main File
int main()
{
//Call to Menu Class
Menu menuVariable;
menuVariable.options();
return 0;
}