The code uses non-standard C++ which should be discouraged. These 
compiler specific codes should not be posted.

Abhijeet Rastogi
(shadyabhi)
http://www.google.com/profiles/abhijeet.1989



Jalpan Randeri wrote:
>
> i was working on the program that will take username and password from 
> user...
>
> now i wanted show * on every key press in password menu/...
> thats y i use the getch() function...
> my code looks like this...
> here i give the whole code..
>
> =================================================
> #include <iostream.h>
> #include<fstream.h>
> #include<stdio.h>
> #include<conio.h>
> #include<string.h>
>
> int main ()
> { clrscr();
> cout <<endl<< "Enter your username :";
> char user[10];
> cin>>user;
> cout << "Enter you password: " ;
> char pass[20];
> int i=0;
> while(ch[i]!='\n') ( "here is my problem occures it doesnt exit when i 
> press enter key.")
> {
> ch[i]=getch();
> cout << " * " ;
> i++;
> }
> ifstream OpenFile ("user.txt");
> char user_saved[10];
> char ch;
> int i=0;
> while (OpenFile.eof()!=0)
> {
> OpenFile.get(user_saved[i]);
> i++ ;
> }
> OpenFile.close();
> ifstream OpenFile1 ("pass.txt");
> char pass_saved[20];
> i=0;
> while(OpenFile1.eof()!=0)
> {
> OpenFile1.get(pass_saved[i]);
> i++;
> }
> OpenFile1.close();
> cout<< pass<<"password enterd"<<endl;
> cout<<pass_saved<<"password saved"<<endl;
> int user1,pass1;
> pass1= strcmp(pass,pass_saved);
> user1= strcmp(user,user_saved);
>
> cout << pass1 << "pass1"<<endl;
> cout << user1 << "user1"<<endl;
> if(user1==0 && pass1==0)
> cout<<endl<<"login sucessful";
> else
> cout<<endl<< "username or password is invalid";
>
> getch();
> return 0;
> }
>
> ----------------------------------------------------------
>
> DoN't let anyoNe steAl yoUr dreAm.
> It's yoUr dreAm, not theiRs.
>
> with Regrads...
> JalpAn RandeRi
>
> The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
> http://in.yahoo.com/ <http://in.yahoo.com/>
>
> [Non-text portions of this message have been removed]
>
> 


------------------------------------

To unsubscribe, send a blank message to 
<mailto:c-prog-unsubscr...@yahoogroups.com>.Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/c-prog/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/c-prog/join
    (Yahoo! ID required)

<*> To change settings via email:
    c-prog-dig...@yahoogroups.com 
    c-prog-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    c-prog-unsubscr...@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to