int main() { /*std::ifstream myfile; myfile.open("users.txt"); //default modes: ios::in and ios::out for input and output std::string user; */ curr_user = nullptr; usernetwork.readFromFile(); cout << "User Network read from file. " << endl; char choice; // command entered by user do { (loginStatus) ? print_login_menu(uname) : print_menu(); choice = toupper(get_command()); switch (choice) { //basic functions case 'C': //create new user createUser(); break; case 'L': //login if (!loginStatus) userLogin(); else loginStatus = false; break; case 'Q': break; case 'A': if (loginStatus) { addFriend(); break; } case 'D': //display wall if (loginStatus) { displayWall(uname); break; } case 'N': //create new post on wall if (loginStatus) { createNewPost(uname); break; } case 'E': // enter my wall if (loginStatus) { enterPost(curr_user); break; } //debug functions case 'P': //print all users show_network(usernetwork); break; case 'F': // Display my friend if (loginStatus) { displayAllFriend(); break; } case 'I': // Enter my friend's wall if (loginStatus) { enterFriendWall(); break; } case 'R': // Get the Route of other user if (loginStatus) { getTheRoute(); break; } case 'S': // Find my possible friend if (loginStatus) { getpossibleFriend(); break; } default: cout << choice << " is invalid." << endl; } } while (choice != 'Q'); usernetwork.writeToFile(); return 0; }