#include<stdio.h>
int main()
{
int i=99,a=3,p=44;
printf("%d %d %d");
return 0;
}
/*Output*/
134518324 99 3
Is the output compiler dependent?
Yes, and system, and possibly even invocation dependent if the
address space is randomised each invocation to prevent shellcode
attacks. The implementation is free to segfault or anything else
it likes in this situation, but the most likely real-world outcome
is as here, where it seems that printf is looking on the stack for
the missing parameters. Since none have been placed there it is
finding things that are not really intended for it, at least not
in this context. It finding the storage allocated to i and a should
therefore come as no surprise. I imagine the 134518324 is the return
address for when printf returns - if you look it up in a debugger
you will probably find it is the address of the return statement.