Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (anonymous):

In C programming language if I write scanf("%d%d",&a,&b); it works fine but if I write: scanf(" %d%d",&a&b); then it prompts for third input.?(notice there is a space before first % operator). Moreover if I give more space then also it only prompts for only 1 extra input why is that.

OpenStudy (anonymous):

Which compiler are you using?

OpenStudy (farmdawgnation):

What exactly are you trying to accomplish?

OpenStudy (asnaseer):

If you look at the format specification here: http://en.wikipedia.org/wiki/Scanf_format_string you will: (space): Space scans for whitespace characters. i.e. a space in the format string will try to match whitespace characters in the input (e.g. space, tab, newline) There is also a discussion on this here: http://bytes.com/topic/c/answers/559335-spaces-scanf-format-string

OpenStudy (anonymous):

i see white space which the compiler probably reconizes in a URL encodeded string %d%d usually means white space or some other special character look it up on a ASCII refrence or whatever encoding method u using there. grain of salt I am only guessing.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!