i wrote the following program
#include
main()
{
int i = 2;
float c = 4.5;
printf(\"%d\\n\",c);
printf(\"%f\\n\",i);
return 0;
}
Basically, the format placeholder is an instruction to the function about how to retrieve and interpret the next chunk of memory from the variable length argument list. It expects the format to be exactly what you tell it. When you retrieve memory in unintended ways, you can cause all sorts of issues and undefined behavior. This is why printf and its ilk are exploitable.