thanks for your time
Any body please explain the actual mechanism performed while executing the printf()( with the help of stack if possible )
eg: printf("%d%d",a++,--a,a--);
(let's suppose there are 3 %d's, not 2 ) first of all, it's bad code and result of it is undefined - it depends on how compiler decide to evaluate argument for function - left to rigth or right to left.
googling pattern - sequence point
As for this code ( besides 'what a is equal to after all this' ) it looks like the following( assuming all arguments are passed on stack that is not always true )
it places, say, address of string, then a, a-1, a in 4 consecutive say, 4-bytes locations on stack and calls printf. Then printf, knowing address of first argument (char*) iterates over 3 other using va_arg knowing arguments' size given in format string ( %d -say, 4 bytes ) I.e. address of second argument is (address of first) - 4.