HELP!! can someone please help me, because i need to create a game in which i have to count how many times i've pressed enter in a matter of 1 minute.
cheers07
0
Newbie Poster
Recommended Answers
Jump to PostWhat operating system and what compiler ? The easiest way to capture the Enter key would be to use the non-standard functions in conio.h, but your compiler may or may not support that.
Jump to PostI'm not going to write the program for you, but to get the Enter keys
while(_kbhit() ) { int c = getche(); if( c == '\n' ) { printf("got one\n"); } }
All 5 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
cheers07
0
Newbie Poster
cheers07
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
cheers07
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.