Hm, afaik there is no easy way of doing this. I once was messing around with some code, and it stopped a user inputting a wrong character type (so the user couldn't type a char into an int or vice versa). That interacted with the TTY layer (on a linux box)..
I don't think it is all that hard. Try something like this.
#define backSpace 8
#define newLine 13
// you can make it better by passing the length of the password
// and testing for the length as well as newLine.
int GetPassword(char *str);
int GetPassword(char *str)
int i = 0,end = 0;
if (i > 0)
*str = '\0';
end = 1;
*str = ch;
There is a simple way to do this. Initialize a character a and write a=getch(). This would not display the character entered by the user.
a=getch(); // varable a will have the character entered by the user.The character
cout<<'*'; // entered by the user will not be displayed. cout<<'*' will put '*'
//appearing to the user that character that he entered was masked
Instead of a character, declare varable a as a character array. Put that in for loop(a=getch etc.,). The password that the user enters is masked now.Though getch() is not in ANSI c standard it will work.
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"