Do I understand that by using the following code

a = getchar(); 
 b = getchar();

, after pressing "1" and "Enter" keys ( Enter - to continue programs work), we can derive the following variables -

a = '1';
b= '\n';

thanks in advance))

Recommended Answers

All 2 Replies

Yes that's correct if your input buffer is empty.

commented: ++++++ +1
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.