Click here to Skip to main content
14,391,749 members

C / C++ / MFC

 
AnswerRe: c++ string_view Pin
Graham Breach14-Nov-19 13:10
MemberGraham Breach14-Nov-19 13:10 
GeneralRe: c++ string_view Pin
T Bones Jones15-Nov-19 4:44
MemberT Bones Jones15-Nov-19 4:44 
QuestionPROGRAMMER'S MOM- Needs your help =) Pin
Member 1465597214-Nov-19 8:57
MemberMember 1465597214-Nov-19 8:57 
AnswerRe: PROGRAMMER'S MOM- Needs your help =) Pin
OriginalGriff14-Nov-19 8:59
mveOriginalGriff14-Nov-19 8:59 
Questionpassword in star form Pin
Member 1461560312-Nov-19 0:34
MemberMember 1461560312-Nov-19 0:34 
AnswerRe: password in star form Pin
CPallini12-Nov-19 1:33
mveCPallini12-Nov-19 1:33 
SuggestionRe: password in star form Pin
David Crow12-Nov-19 6:48
MemberDavid Crow12-Nov-19 6:48 
AnswerRe: password in star form Pin
Stefan_Lang12-Nov-19 22:07
MemberStefan_Lang12-Nov-19 22:07 
Unfortunately there is no way in standard C/C++ to do that, but I see you're already using non-standard functions anyway. As David pointed out, _getch() should do the trick:
#include "stdio.h"
#include "conio.h"

int main()
{
    char c;
    c = _getch();
    putchar('*');
    printf("\nYou entered %c\n", c);
    _getch(); // just to pause the program before closing the output console
    return 0;
}

If this doesn't work, refer to this thread for more advice: c++ - Capture characters from standard input without waiting for enter to be pressed - Stack Overflow[^]
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

QuestionHow to make the heap address(by new) have the same every time the program runs? Pin
Member 1308136910-Nov-19 16:36
MemberMember 1308136910-Nov-19 16:36 
AnswerRe: How to make the heap address(by new) have the same every time the program runs? Pin
k505410-Nov-19 17:19
Memberk505410-Nov-19 17:19 
GeneralRe: How to make the heap address(by new) have the same every time the program runs? Pin
Member 1308136920-Nov-19 16:48
MemberMember 1308136920-Nov-19 16:48 
AnswerRe: How to make the heap address(by new) have the same every time the program runs? Pin
CPallini11-Nov-19 23:10
mveCPallini11-Nov-19 23:10 
GeneralRe: How to make the heap address(by new) have the same every time the program runs? Pin
Member 1308136920-Nov-19 16:49
MemberMember 1308136920-Nov-19 16:49 
QuestionRe: How to make the heap address(by new) have the same every time the program runs? Pin
David Crow12-Nov-19 6:46
MemberDavid Crow12-Nov-19 6:46 
AnswerRe: How to make the heap address(by new) have the same every time the program runs? Pin
Member 1308136920-Nov-19 16:56
MemberMember 1308136920-Nov-19 16:56 
AnswerRe: How to make the heap address(by new) have the same every time the program runs? Pin
leon de boer13-Nov-19 3:34
Memberleon de boer13-Nov-19 3:34 
GeneralRe: How to make the heap address(by new) have the same every time the program runs? Pin
Richard MacCutchan13-Nov-19 6:01
mveRichard MacCutchan13-Nov-19 6:01 
QuestionCTreeCtrl item images without CImageList ? Pin
Maximilien30-Oct-19 9:32
MemberMaximilien30-Oct-19 9:32 
AnswerRe: CTreeCtrl item images without CImageList ? Pin
Richard MacCutchan30-Oct-19 10:42
mveRichard MacCutchan30-Oct-19 10:42 
GeneralRe: CTreeCtrl item images without CImageList ? Pin
Maximilien30-Oct-19 13:04
MemberMaximilien30-Oct-19 13:04 
QuestionFTPS Connection Pin
Paul201324-Oct-19 11:28
MemberPaul201324-Oct-19 11:28 
QuestionRe: FTPS Connection Pin
David Crow29-Oct-19 10:10
MemberDavid Crow29-Oct-19 10:10 
AnswerRe: FTPS Connection Pin
Paul201330-Oct-19 9:25
MemberPaul201330-Oct-19 9:25 
QuestionRe: FTPS Connection Pin
David Crow30-Oct-19 11:17
MemberDavid Crow30-Oct-19 11:17 
AnswerRe: FTPS Connection Pin
Paul201330-Oct-19 12:30
MemberPaul201330-Oct-19 12:30 

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.