Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

slightlywhacked

...little ***** thingies

This topic is 6589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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;
}

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!