C PROGRAM TO ECHO "*" - C PROGRAM TO GET PASSWORD FROM USER
How to Enter Password in C language:
Have you ever wondered how you can echo '*' when user input sensitive information in C, Same as we observe in a webpage by just typing:
Now, Doing the same in C is also simple i just wondered how to do that and came up with solution
KUDOS!!
Have you ever wondered how you can echo '*' when user input sensitive information in C, Same as we observe in a webpage by just typing:
<input type = "password"/>
Now, Doing the same in C is also simple i just wondered how to do that and came up with solution
#include <stdio.h>
#include <conio.h>
void main(){
char pass[100];
int i = 0;
do{
pass[i] = getch();
if(pass[i] == '\n'){
break; // if user press enter it breaks the loop..
}
printf("*");
i++;
} while(1); // Always true You can put your condition here..
}
If you like my code then feel free to comment your feedback and share & subscribe this post.#include <conio.h>
void main(){
char pass[100];
int i = 0;
do{
pass[i] = getch();
if(pass[i] == '\n'){
break; // if user press enter it breaks the loop..
}
printf("*");
i++;
} while(1); // Always true You can put your condition here..
}
KUDOS!!
Comments
Post a Comment