引用:
原文由 starforce 所發表
1.沒有呼叫STRING
|
What compiler do you use?
The following has been tested with Dev C++
no error messages were generated,
so it should be correct this time,
------------------------------------------------
#include<iostream>
using namespace std;
int main() {
bool isMatch = false;
string userInput, pass = "defaultpass";
int counter = 1;
cout << "Please enter your password" << endl;
cin >> userInput;
for(int counter = 1; counter <=3 && !(userInput == pass); counter++)
{
cout << "Please try again" << endl;
cin >> userInput;
}
if(!isMatch)
cout << "pass locked" << endl;
return 0;
}