Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,047 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,521 people online right now. Registration is fast and FREE... Join Now!




masking a password input

 
Reply to this topicStart new topic

masking a password input

dictionary
18 Jul, 2008 - 08:51 AM
Post #1

New D.I.C Head
*

Joined: 18 Jul, 2008
Posts: 6

CODE
#include<conio.h>
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#define TRUE 1

void menu(void);
void add(void);
void list(void);
void mod(void);
void search(void);
void del(void);
void quit(void);

struct my_struct
{
    int  studentid;
    char studentname[20];
    char ic[10];
    int  age;
    char dob[10];
    char address[50];
    char phone[20];
    char email[20];
    char password[7],userpw;
    }s1;

FILE *stream;

void main(void)
{

      char password[7] = "sas";
      char userpw[7];

int i = 1;
      for(i=0;i<3;i++)
     {
          clrscr();
printf("\n");
       printf("\n\t\tWelcome to Student Administration System ");
           printf("\n\t\t****************************************");
       printf("\n");
           printf("\n\t\tEnter Password:  ");
         gets(userpw);
        
                   if(strcmp(password,userpw) == 0)
             menu();
           else
              printf("\n\t\tInvalid password ! Pls Try Again: _ ");
            getch();


}    }

User is offlineProfile CardPM
+Quote Post

dictionary
RE: Masking A Password Input
18 Jul, 2008 - 09:03 AM
Post #2

New D.I.C Head
*

Joined: 18 Jul, 2008
Posts: 6

i need a little help with the above code. i need to mask the password input. i have tried a lot with the help i got from this site but still coudn't do it
User is offlineProfile CardPM
+Quote Post

gabehabe
RE: Masking A Password Input
18 Jul, 2008 - 09:18 AM
Post #3

Donkey DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 5,522



Thanked: 96 times
Dream Kudos: 2650
Expert In: ruling the world.

My Contributions
Click that "My contributions" link under my name, and find "Secure password entry in the console"

Make sure you get the C version though, there's a C++ version too smile.gif
User is offlineProfile CardPM
+Quote Post

dictionary
RE: Masking A Password Input
18 Jul, 2008 - 09:55 AM
Post #4

New D.I.C Head
*

Joined: 18 Jul, 2008
Posts: 6

QUOTE(gabehabe @ 18 Jul, 2008 - 10:18 AM) *

Click that "My contributions" link under my name, and find "Secure password entry in the console"

Make sure you get the C version though, there's a C++ version too smile.gif



thanks a lot for the help icon_up.gif
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 05:12PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month