From: sparhawk AT eunet DOT at (Gerhard Gruber) Newsgroups: comp.os.msdos.djgpp Subject: Re: What is wrong here? Date: Tue, 16 Jun 1998 21:33:17 GMT Organization: Customer of EUnet Austria Lines: 41 Message-ID: <3590df4b.5039849@news.Austria.EU.net> References: <358586A1 DOT 6BD84ACD AT algonet DOT se> NNTP-Posting-Host: e190.dynamic.vienna.at.eu.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Destination: Erik From: Gruber Gerhard Group: comp.os.msdos.djgpp Date: Mon, 15 Jun 1998 22:40:01 +0200: >#include >#include >#include > >int main() >{ > clrscr(); > > char user_name[5] = "test"; > char user_try[20]; > > cout << "Enter password: "; > cin >> user_try; > > if (!strcmp(user_try, user_name)) > cout << "Password Correct" << endl; > else > cout << "Wrong Password" << endl; > >return 0; >} > >It compiles good, but when I run the program and enter "test" it says: >"Wrong Password". What is wrong? How did you compile it? I run "g++ -o test.exe test.cc" and it worked. Enter Password: test Passwort correct -- Bye, Gerhard email: sparhawk AT eunet DOT at g DOT gruber AT sis DOT co DOT at Spelling corrections are appreciated.