Im trying to teach myself C++ and this is a program I am working on at the moment but I'm having a problem with the password loop. Even why I type in the correct username and password it just keeps asking me for the username again and again instead of going to the void menu funciton
#include <iostream> #include <stdio.h> #include <string> #include <fstream> using namespace std; void menu(int argc, const char * argv[], char text[2000]); string encryptDecrypt(string toEncrypt) { char key = 'K'; //Any char will work string output = toEncrypt; for (int i = 0; i < toEncrypt.size(); i++) output[i] = toEncrypt[i] ^ key; return output; } void menu(int argc, const char * argv[], char text[2000]) { system("color 0A"); //ifstream my_input_file; ofstream my_output_file; my_output_file.open("output_data.txt"); cout<<"Please enter your text: "; //cin>>text; //cin.ignore(); //cin.getline(text, sizeof text); cin.getline(text,2000); //cout<<"You entered: "<< text <<"\n"; //string encrypted = encryptDecrypt("kylewbanks.com"); string encrypted = encryptDecrypt(text); cout << "Encrypted:" << encrypted << "\n"; string decrypted = encryptDecrypt(encrypted); cout << "Decrypted:" << decrypted << "\n"; my_output_file << "Your encrypted text is: " << encrypted; my_output_file.close(); cin.get(); } int main() { string username; string password; do { cout << "username: "; getline(std::cin, username); if (username == "John") { std::cout << "password: "; getline(std::cin, password); if (password != "1234") { cout << "invalid password. try again." << std::endl; } else if (password == "1234"){ void menu(int argc, const char * argv[], char text[2000]); } } else { std::cout << "invalid username. try again." << std::endl; } } while (password != "1234"); return 1; } 
void menu(int argc, const char * argv[], char text[2000]);does not call a function.cherryor1234?