www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/17/01:30:43

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
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Destination: Erik <edroszcz AT algonet DOT se>
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: Mon, 15 Jun 1998 22:40:01 +0200:

>#include <conio.h>
>#include <iostream.h>
>#include <string.h>
>
>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<CR>
Passwort correct
--
Bye,
   Gerhard

email: sparhawk AT eunet DOT at
       g DOT gruber AT sis DOT co DOT at

Spelling corrections are appreciated.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019