This boot-up password program compiles and runs with MSVC++. Now I want to compile it using GCC (DJGPP), and I get this error which I don't understand:
password.cpp: In function 'int main(...)'
password.cpp: 48: implicit declaration of function 'int strcmpi(...)'
What? Implicit? Understood but not stated? Does anyone know what is meant by this error? I belive the same error applies to my every other call of 'strcmpi()', if I were to remove the one mentioned.
Here is the main function:
Code:int main() { char* password = new char[50]; char* response = new char[50]; bool ChangePassword = false; bool bypass = false; ifstream ReadPasswordFile; ofstream WritePasswordFile; ReadPasswordFile.open("c:\\password.psw"); system("cls"); if(ReadPasswordFile.fail()) { cout << "Could not open password file: using default password" << endl; strcpy(password,"ishboo"); } else { ReadPasswordFile.getline(password,50); if(password[0] == (char)141) { ReadPasswordFile.close(); return 0; } } ReadPasswordFile.close(); while(1) { cout << "What's the password?" << endl; //PASSWORD ENTRY PUMP (DISPLAYS ONLY '*') PasswordPump(response); //END PASSWORD ENTRY PUMP (DISPLAYS ONLY '*') if(!strcmpi(response,password)) { cout << "Thanks youz!"; for(int x = 12; x < strlen(response); x++) putch(32);//space putch('\n'); if(ChangePassword) { while(1) { cout << "\nInput new password: "; PasswordPump(password); cout << endl; cout << "Plese retype: "; PasswordPump(response); cout << endl; if(!strcmpi(password,response)) { WritePasswordFile.open("c:\\password.psw"); if(!WritePasswordFile.fail())//if it succeeded WritePasswordFile << password; else { cout << "Could not open \"c:\\password.psw\"." << endl; break; } cout << "Password change complete!" << endl; WritePasswordFile.close(); break; } else { cout << "Those two are inconsistant!" << endl; } } } if(bypass) { WritePasswordFile.open("c:\\password.psw"); if(!WritePasswordFile.fail())//if it succeeded WritePasswordFile << (char)141; else { cout << "Could not open \"c:\\password.psw\"." << endl; break; } cout << "Password bypassed!" << endl; WritePasswordFile.close(); } break; } else if(!strcmpi(response,"change password") || !strcmpi(response,"changepassword")) { ChangePassword = true; wrong(response); } else if(!strcmpi(response,"bypass")) { bypass = true; wrong(response); } else wrong(response); } //system("cls"); return 0; }



LinkBack URL
About LinkBacks


