I want to use scanf to get up to 10 chars. Each char will go into a different variable. Here is my code.
scanf("%c%c%c%c%c%c%c%c%c%c", &c1, &c2, &c3, &c4, &c5, &c6, &c7, &c8, &c9, &c10);
The problem: I do not care if the user does not enter 10 chars. I want to allow the user to enter any number of chars up to a maximum of 10. But if the user enters say 5 chars and press enter, the program will wait for another 5 chars. How do I stop it from waiting? Thanks