Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

C++ some few questions...


ghost's Avatar
0 0

I have some few question to c++:

  1. how can i make the pass box in console app, and when user type some text, it is replaced to ***, is this possible? eh.. bad question, of course, it is possible, but the right question: how can i do this? 2)how can i make the gui app, but in console? probably you dont understand me, but i wanna to make a virtual bios simmulator, and i saw this in another program, it is simple console window, and there you have blue background, some input fields and when you press down up right left arrow, you travelling… how can i make this? thanks in advance

ghost's Avatar
0 0
#include <conio.h>

string pass = "";
char c;
while (c != 13)
{
c = (char)getch();
if(c == 13) break;
pass += c;
cout << "*";
}

That will replace the user's input with stars, and append each letter to the pass string.


ghost's Avatar
0 0

2)how can i make the gui app, but in console? probably you dont understand me, but i wanna to make a virtual bios simmulator, and i saw this in another program, it is simple console window, and there you have blue background, some input fields and when you press down up right left arrow, you travelling… how can i make this? thanks in advance

so do you enter fields and then it comes up in a gui app or is it console all the time


mido's Avatar
Member
0 0

For question 1, i don't know and i want' someone to answer it lol for 2…if youre using Trubo C++ or Borland you can include graphics.h and conio.h and use the "textcolor()" and "textbackground" highvideo() window() etc…


mido's Avatar
Member
0 0

mastergamer: i think you forgot to : #include <string>


ghost's Avatar
0 0

mido wrote: mastergamer: i think you forgot to : #include <string>

Yea I know, I just pasted the code and the include that you wouldn't normally use.


mido's Avatar
Member
0 0

Lol, ok thank you btw, i was askin same question :D


ghost's Avatar
0 0

thanks to all for their help ;)