I have a simple C program which basically compares two strings and reports whether they are the same or not. Hence it can be used to verify whehter 2 given passwords are the same or not.
I wanted to know how you can make the '*' sysmbol appear instead of the password characters.
example:
if input is "admin"
Enter password : ****
Re-enter password : ****
I was doing a for loop for that, but cannot get it to work.
Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
#define ff fflush(stdin);
void main()
{
int r;
char str1[10], str2[10];
clrscr();
printf("Enter password:\n");
gets(str1);
ff;
printf("Re-enter password:\n");
gets (str2);
ff;
r=strcmp(str1, str2);
if(r==0)
{
printf("Enter");
}
else
{
printf("Exit");
}
getch();
}
i made a this small example with for loop but cannot connect it with the gets() function
Code:
#include <stdio.h>
#include <string.h>
int main() {
char name[6] = "amar";
int i;
for(i = 0; i < strlen(name); i++) {
printf("*");
}
printf("\n");
}
If you could help me there ..
thanks anyways.....