Take the C language as an example for this question. In the C language we can see many format specifiers, such as %i %d %c %s %f
etc. In the compilation process, the C code is converted into an assembly code.
e.g. 1
char *a = "Hello World !\n";
and the assembly code is :
.LC0:
.string "Hello world !", 10
e.g. 2
printf("Hello %s", "World !");
and the assembly code is :
.LC0:
.string "World !"
.LC1:
.string "Hello %s"
and the output is :
Hello World !
And how does %s
format specifier works in compilation process?