Important alert: (current site time 7/15/2013 5:49:51 PM EDT)
 

VB icon

^! No. 1 full proof password input program with support of Backspace key and password length restric

Email
Submitted on: 2/6/2004 5:18:29 AM
By: my name is Nitin Jindal (from Panchkula,Haryana)  
Level: Intermediate
User Rating: By 3 Users
Compatibility: C, C++ (general)
Views: 25554
(About the author)
 
     /** No. 1 full proof password input program with support of BackSpace key and password length restriction. Have u ever seen this kind of progran on planet-source-code? PLEASE VOTE FOR ME...Nitin Jindal */
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: ^! No. 1 full proof password input program with support of Backspace key and password length restric
// Description:/** No. 1 full proof password input program with support of BackSpace key and password length restriction. Have u ever seen this kind of
progran on planet-source-code? PLEASE VOTE FOR ME...Nitin Jindal */
// By: my nameis Nitin Jindal (from Panchkula,Haryana)
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=7586&lngWId=3//for details.//**************************************

/** No. 1 full proof password input program with support of BackSpace key and password length restriction. Have u ever seen this kind of
progran on planet-source-code? PLEASE VOTE FOR ME...Nitin Jindal........... */
#include <stdio.h>
#include <conio.h>
password(char *,int);
main()
{
char *pass;
printf("Enter Password to continue ");
password(pass,10);/* 10 is password length */
printf("\nYour password is %s",pass);
}
password(char *str,int tot)
{
char ch;
int row,col,r,c,u;
int i=0;
row=wherey();
col=wherex();
r=wherey();
c=wherex();
textcolor(BLACK);
textbackground(WHITE);
for(u=0;u<tot;u++)
{
gotoxy(c,r);
cprintf(" ");
c++;
}
gotoxy(col,row);
textcolor(WHITE);
textbackground(BLACK);
while(1)
{
fflush(stdin);
if((ch=getch())==0)
{
getch();
continue;
}
if(ch=='\r')
{
str[i]='\0';
break;
}
if(ch=='\b' && i>0)
{
i--;
gotoxy(col+i,row);
printf(" ");
gotoxy(col+i,row);
continue;
}
if(ch<32)
continue;
gotoxy(col+i,row);
printf("%c",254);
str[i]=ch;
i++;
if(i==tot)
{
str[i]='\0';
break;
}}
return 0;
}


Other 5 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

2/14/2004 12:08:55 PM

Its fine!
(If this comment was disrespectful, please report it.)

 
7/7/2004 5:11:44 AMSanchit Karve

When Compiled with Borland C++ 5.02 it gives an access violation run-time error as soon as a key is pressed. Have you tested it on Borland C++?
(If this comment was disrespectful, please report it.)

 
9/1/2004 11:27:37 AM

y i cant run this program, it got error and warning.
(If this comment was disrespectful, please report it.)

 
9/26/2004 1:39:37 PMNDawg

you get an access violation because the char pointer he is using was never allocated. In other words, you are writing to memory that does not belong to the program.
(If this comment was disrespectful, please report it.)

 
2/4/2005 2:19:47 AM

The programs are nice...but why is it when compiling one the program has an error.sample..value return..but anyway thank you for posting those programs I've learn many thing about it specially graphics. Post more!!
(If this comment was disrespectful, please report it.)

 
11/24/2005 2:50:28 AMsaira

i had try to run this program in dev c++
but got error...
(If this comment was disrespectful, please report it.)

 
1/10/2006 10:30:09 AMDead man

The code is missing the " Return 0; " statement after the line printf("\nYour password is %s",pass); ....hence Some people might be having warning while compiling ...just add the return 0; statement after the printf line and the code will work
(If this comment was disrespectful, please report it.)

 
3/28/2006 7:29:44 PMjm

Hi people!!! planet source code rulez!!!!
(If this comment was disrespectful, please report it.)

 
6/7/2006 1:49:04 PMishtiaq

had try to run this program in dev c++
but got error...
thanks
(If this comment was disrespectful, please report it.)

 
3/14/2007 9:51:57 PMArturia

I'm a complete newbie when it comes to C/C++, can anyone tell me what this error means?

--------------------Configuration: main - Win32 Debug--------------------
Compiling...
sec.cpp
C:\Documents and Settings\Asturia\Desktop\New Bank\sec.cpp(49) : error C2065: 'wherey' : undeclared identifier

(If this comment was disrespectful, please report it.)

 
12/20/2007 11:34:52 AMSeth Farrington

Well, well, well....Looks very similar to a program I wrote a while ago, I must say mine appears to be much better.
(If this comment was disrespectful, please report it.)

 
2/25/2008 1:28:52 AMAce Ex

Pls.. translate it to dev c++...
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.