Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how many values we can get input in scanf function?i.e limitation of getting input in scanf
Posted
Updated 16-Oct-15 22:29pm
v2
Comments
Richard MacCutchan 17-Oct-15 4:46am    
As many as you want. Why not try some tests for yourself, you'll be amazed at what you can learn?

1 solution

There is no limit defined in "the standard" - which means it's likely to be implementation dependant, and can vary from system to system depending on how the library author was feeling when you wrote it.

But...given that it reads from stdin and thus is intended for user input rather than a file it would probably be a good idea to minimise the amount you process in a single statement in order to reduce the "PITA factor" when the user makes a mistake in the second value...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900