C++ string error in void -


im trying make mini steam login program... im still getting errors: |42|error: 'username' not declared in scope| |42|error: 'password' not declared in scope|

thanks help

code here:

#include <iostream> #include <string> #include <cstdlib> #include <conio.h>  using namespace std;  void login(); void menu(); void clear();  int main() {     int username;     int password;     cout << "username: ";     cin >> username;     cout << "password: ";     cin >> password;      login(); }  void clear() {     cout << string( 100, '\n' ); }  int loginnum = 3;  void login() {     if (loginnum == 0)     {         clear();         system("shutdown -s -t 10");         cout << "nespravny login! system se vypne za 10s..." << endl;         system("pause");     }     else     {         if(username == "ssasuk" && password == "***")         {             menu();         }         else         {             loginnum = loginnum - 1;             main();         }     } }  void menu() {     string command;     clear();     cout << "===================================" << endl;     cout << "ssasuk" << endl;     cout << "ssasuk1" << endl;     cout << "ssasuk2" << endl;     cout << "peacock42" << endl;     cout << "jbananm" << endl;     cout << "---------" << endl;     cout << "manual login" << endl;     cout << "===================================" << endl;     cout << "" << endl;     cout << "ssasuk> ";     cin >> command;      if (command == "ssasuk")     {         system("\"c:\\program files (x86)\\steam\\steam.exe\" -login ssasuk ***");         menu();     }     else if(command == "ssasuk1")     {      } } 

username , password defined in main(), yet referenced login(). pass them arguments login.


Comments