Yes it's me again and another one of my little college programs that I can't get working.. I really wish they'd start teaching us with an up to date compiler rather than one that's 8 years old.. Anywayz, why doesn't this work.. According to what we've been taught in class it should so I'm confused.. The exercise is to accept the password borland regardless of case.. Thanks!
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
string szPassword;
cout << "Please enter the password"<<endl;
cin >> szPassword;
if (stricmp(szPassword, "borland")
{
cout << "Access Granted"<<endl;
}
else
{
cout <<"Access Denied"<<endl;
}
system("PAUSE");
return 0;
}
Question
mark52230
Yes it's me again and another one of my little college programs that I can't get working.. I really wish they'd start teaching us with an up to date compiler rather than one that's 8 years old.. Anywayz, why doesn't this work.. According to what we've been taught in class it should so I'm confused.. The exercise is to accept the password borland regardless of case.. Thanks!
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { string szPassword; cout << "Please enter the password"<<endl; cin >> szPassword; if (stricmp(szPassword, "borland") { cout << "Access Granted"<<endl; } else { cout <<"Access Denied"<<endl; } system("PAUSE"); return 0; }Link to comment
Share on other sites
10 answers to this question
Recommended Posts