Does anyone know what is the best function to use if you want to read user input and not have the return key carry over? Everytime I write something that reads in two things, the second read in always ends up being '\n' because the return key carries over to the next input.
Mr.UNOwen
0
Junior Poster
Recommended Answers
Jump to PostThere are a few things you can try out. For eg. you can accept everything as string from the user and parse it to get out the data which you require using [search]sscanf( )[/search]
int main( ) { char buffer[BUFSIZ] = { '\0' } ; char name[8] …
All 3 Replies
sunhika
0
Newbie Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
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.