Click here to Skip to main content
15,896,359 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: convert binary file to image/bmp file in vc++ Pin
shiv@nand12-Nov-10 4:18
shiv@nand12-Nov-10 4:18 
GeneralRe: convert binary file to image/bmp file in vc++ Pin
Maximilien12-Nov-10 5:03
Maximilien12-Nov-10 5:03 
GeneralRe: convert binary file to image/bmp file in vc++ Pin
Richard MacCutchan12-Nov-10 9:59
mveRichard MacCutchan12-Nov-10 9:59 
AnswerRe: convert binary file to image/bmp file in vc++ Pin
AmbiguousName12-Nov-10 8:26
AmbiguousName12-Nov-10 8:26 
AnswerRe: convert binary file to image/bmp file in vc++ Pin
aresthelord8-Mar-11 23:15
professionalaresthelord8-Mar-11 23:15 
Questionwhat is valid range of port number to use sockaddr_in? Pin
Le@rner11-Nov-10 23:59
Le@rner11-Nov-10 23:59 
AnswerRe: what is valid range of port number to use sockaddr_in? Pin
Richard MacCutchan12-Nov-10 0:54
mveRichard MacCutchan12-Nov-10 0:54 
QuestionHow to clear characters from the console window Pin
Danzy8311-Nov-10 22:14
Danzy8311-Nov-10 22:14 
Hi everyone! I am writing a Bank Simulation program in C++ and it's a console application. In entering account passwords I do not want the characters entered to be shown on screen but to output the asterik character for every character entered as follows

while (true)
{
    cout << "\n\nEnter administrator account password (press C to cancel): ";
		
    int i(0);
    char input;

    while ((input = getch()) != '\r' && i < ADMINISTRATOR::ADMIN_PASS_LENGTH)
    {
        if (input == '\b')
	{
            if (i > 0)
            {
	        password[i - 1] = '\0';
	        --i;
			
	        continue;
            }
	}

	password[i] = input;
	++i;

	cout.put('*');
    }

    password[ADMINISTRATOR::ADMIN_PASS_LENGTH - 1] = '\0';

    .... 
    ....
}


I used the function
getch()
which provides unbuffered input. When a character is entered, it is saved and the asterik character (*) is printed on the screen. If the character entered is the backspace, the last character saved in the password buffer is cleared by setting it to '\0'. This seems to work fine.

Now the problem is that when the backspace character is entered, I also want to clear the asterik characters printed in the console window so that it can be seen that the asterik characters are being cleared but I don't know how I can clear the asterik characters as the user presses the backspace character. I need help.
AnswerRe: How to clear characters from the console window Pin
CPallini11-Nov-10 23:59
mveCPallini11-Nov-10 23:59 
AnswerRe: How to clear characters from the console window Pin
Cool_Dev12-Nov-10 1:42
Cool_Dev12-Nov-10 1:42 
QuestionRe: How to clear characters from the console window Pin
David Crow12-Nov-10 3:34
David Crow12-Nov-10 3:34 
Questionproject wizard in vs2010 not work properly, and the project can't be created. Pin
followait11-Nov-10 21:44
followait11-Nov-10 21:44 
AnswerRe: project wizard in vs2010 not work properly, and the project can't be created. Pin
Richard MacCutchan11-Nov-10 22:13
mveRichard MacCutchan11-Nov-10 22:13 
GeneralRe: project wizard in vs2010 not work properly, and the project can't be created. Pin
followait12-Nov-10 2:13
followait12-Nov-10 2:13 
GeneralRe: project wizard in vs2010 not work properly, and the project can't be created. Pin
Richard MacCutchan12-Nov-10 2:49
mveRichard MacCutchan12-Nov-10 2:49 
QuestionHow to hide System menu in MDI application without removing the close, minimize/maximize buttons Pin
Prasann Mayekar11-Nov-10 19:35
Prasann Mayekar11-Nov-10 19:35 
QuestionOnNCHitTest Pin
satkan11-Nov-10 18:09
satkan11-Nov-10 18:09 
AnswerRe: OnNCHitTest Pin
Kelly Herald11-Nov-10 18:35
Kelly Herald11-Nov-10 18:35 
QuestionEvery time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
Aseem Sharma11-Nov-10 11:48
Aseem Sharma11-Nov-10 11:48 
AnswerRe: Every time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
enhzflep11-Nov-10 15:34
enhzflep11-Nov-10 15:34 
GeneralRe: Every time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
Aseem Sharma11-Nov-10 19:27
Aseem Sharma11-Nov-10 19:27 
AnswerRe: Every time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
cp987611-Nov-10 19:52
cp987611-Nov-10 19:52 
GeneralRe: Every time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
Aseem Sharma12-Nov-10 5:58
Aseem Sharma12-Nov-10 5:58 
QuestionAdvice on resolving access violation exception. Pin
Chris Meech11-Nov-10 8:21
Chris Meech11-Nov-10 8:21 
AnswerRe: Advice on resolving access violation exception. Pin
Maximilien11-Nov-10 8:59
Maximilien11-Nov-10 8:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.