It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming C and C++ Forum Script-archive

A password program!

Share your completed scripts.

A password program!

Postby sevenaces on Thu May 10, 2007 7:09 pm

I read this one: simple-c-code-vt599.html

Tht ws really borin!
The password seems normal! no nothing like ******...

I made my own! How is it?
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>

void main()
{
pass:
char p[10];
puts("Please set a password.\n");
puts("Enter Your Password : ");
char a[10];
for(int i=0;; i++)
{
p[i]=getch();
if(p[i]==13)
{
puts("\b");
break;
}
putch('*');
}
p[i]='\0';

puts("\nConfirm Password : ");
for(i=0; a[i]!='\0'; i++)
{
a[i]=getch();
if(a[i]==13)
{
break;
}
putch('*');
}
a[i]='\0';
int f=0;

for(i=0; i<strlen(a);i++)
{
if(a[i]!=p[i])
f=1;
}
if(f||strlen(a)!=strlen(p))
{
puts("\n\nPassword did not match.Please reset. ");
goto pass;
}
else
puts("\n\nPassword Accepted");
puts("\n\nPress any key to exit");
getch();
}
----
$even@ce$
Steel is Iron + Fire!!!
My Official web-site : http://www.vpirates.com
User avatar
sevenaces
50+ Club
 
Posts: 63
Joined: Thu Sep 28, 2006 8:44 pm

Return to Script-archive

Who is online

Users browsing this forum: No registered users and 0 guests