Input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Input

char a = getchar(); getchar(); // call getchar() again to consume the line break character that came from pressing {Enter} key or whitespace from {Spacebar} char b = getchar();

24th Nov 2021, 12:43 AM
obedisco T johnny
obedisco T johnny - avatar
1 Answer
0
If your just getting a single char use getc(stdin) int main(void) { int a, b; a = getc(stdin); b = getc(stdin); ... do stuff with your char variables }
24th Nov 2021, 12:47 AM
William Owens
William Owens - avatar