maadhuu said:
i want to know the exact implementation of printf function...what i do
know is that the arguments are pushed into a stack from right to left and
the function is called and then some pointer is set up ....well, where and
how ????
All that is implementation-specific. Different implementations
(compilers and run-time libaries) will do things differently. As far
as the language is concerned, all you know, and all you really need to
know, is that it works.
If you want to know how one particular implementation does this, you
can generate an assembly listing, but whatever you learn from this
won't necessarily be generally applicable. (I'm not trying to
discourage you from looking into this, but implementation-specific
details are generally considered off-topic here.)
also it will be helpful if u can enlightten me on how scanf works and what
should be the output of
scanf("%d %d",&a,"%f",&b,&c); a,b are ints , c is a float.
Undefined behavior. The first argument to scanf() is the format
string, which controls the handling of the other arguments. You're
trying to give it a format string, a pointer to an int, *another*
format string, a pointer to an int, and a pointer to a float. Since
the expected types of the remaining arguments are determined by the
format string, not by the declaration of scanf(), a compiler might not
be able to diagnose the error; it's up to you to make sure the
arguments are correct.
You probably want something like this:
scanf("%d %d %f", &a, &b, &c);
Finally, some friendly advice. If you're going to post here, it's
best not to use abbreviations like "u" for "you". Proper
capitalization is also a good thing.