C Program To Accept Password
Submitted by Srikanth on Tuesday, 11 December 200712 Comments

This is a simple login program in C. While accepting password it masks each character using ‘*’ symbol and display the password in the next line after the user hits Enter key. It also accepts backspaces and acts accordingly.
#include<stdio.h>
#include<conio.h>
#include<conio.h>
char pw[25],ch;
int i;
void main()
{
clrscr();
puts(“Enter password”);
while(1)
{
if(i<0)
i=0;
ch=getch();
if(ch==13)
break; /*13 is ASCII value of ENTER*/
if(ch==8) /*ASCII value of BACKSPACE*/
{
putch(‘\b’);
putch(NULL);
putch(‘\b’);
–i;
continue;
}
pw[i++]=ch;
ch=’*';
putch(ch);
}
pw[i]=’\0′;
printf(“\n\n%s”,pw);
getch();
}
Popularity: 2% [?]
By using/following this site you agree to our Legal Disclaimer


Go home.
Wats great in this?
Good
hi Shrikant,
can you please tell me from where can i get c compiler
@ Virendra
Goto Borland site. Or search on google for Turbo C/C++ compiler
I was wondering if dev-c++ is a good compiler? and if it compiles in c also? Thanks
Hi Srikanth Bro …
I use Turbo c++ 3.1
Which is the best for writing, Editing and compiling C Program ???
Thankyou so much for the code for masking the password….I didn’t understand it fully but it helped a lot.
I Like But I Face An Error on it that 16 bit dos subsystem.What is this????????please help on this topic!!!!!!!!
great!!!!!!!!but it is not working on dev c++.what modification should be done??? plz reply….
Thanking you.
thank you very good article. but I’m running on turbo c saw many errors mean? would you help the address thank you very much taotau9x@gmail.com
Leave your response!
EMAIL SECURITY »
What to Do When Your Email Account is Hacked?
How to Recover Hacked Email Accounts?
It can be a real nightmare if someone hacks and takes control of your email account as it may contain confidential information like bank logins, credit card details and other sensitive data. …
HOW STUFFS WORK »
How Antivirus Software Works
Due to ever increasing threat from virus and other malicious programs, almost every computer today comes with a pre-installed antivirus software on it. In fact, an antivirus has become one of the most essential software package for every computer. Even though every one …
HOW-TO GUIDES »
How to Hide Data in Image, Audio & Video Files: Steganography
Ever wondered to know how to hide secret messages in images, audio and video files? Well, in this post I will take you through a concept called steganography using which, it is possible to hide your secret information …
INTERNET SECURITY »
How to Hide Data in Image, Audio & Video Files: Steganography
Ever wondered to know how to hide secret messages in images, audio and video files? Well, in this post I will take you through a concept called steganography using which, it is possible to hide your secret information …
NETWORK HACKS »
How to Hack an Ethernet ADSL Router
Almost half of the Internet users across the globe use ADSL routers/modems to connect to the Internet however, most of them are unaware of the fact that it has a serious vulnerability which can easily be exploited even by a …
Categories
Most Popular
Most Commented
Blogroll
Log In | Entries (RSS) | Comments (RSS) | Sitemap
© 2008-2011 GoHacking.Com. This content is copyrighted to Srikanth and may not be reproduced on other websites.