Advertisement

...little ***** thingies

Started by November 30, 2000 02:20 PM
1 comment, last by slightlywhacked 24 years, 1 month ago
in dos.. how do I make it so each letter is shown on the screen as a * .. but still saves the string in a variable.. this is for a passowrd thingy .. any suggestions .. remember..dos thanx
BAHcows go moomoos go cow
I don''t think there''s any option to do this in DOS. The only alternative is to write your own input routine which inputs and displays one character at a time.
Advertisement
You could do something like:
  #include <conio.h>#include <stdio.h>int main(int argc, char ** argv) {  int a;  char buffer[256];  char * ptr = buffer;  while ((a = getch()) != 0x0d) {    *ptr = (char)a;    ptr++;    printf("*", a);  }  *ptr = ''\0'';  printf("\n%s\n", buffer);  return 0;}  

This topic is closed to new replies.

Advertisement