+ 1
What is the syntax of printf in C?
Also, explain the parameters.
3 Antworten
+ 2
simple print:
printf("Hello world!");
printing number:
int %d
float %f
char %s
example
int x=4;
printf("X = %d " ,x); // output X=4 number replaced in %d
0
@elie: this is the implementation part. I want to know the general syntax.
0
The prototype is what @Martin Taylor told you. The "..." part is an undefined number of parameter
For more informations on this, search for stdarg.h. I use this in the code below, but they are some complex stuff in it so I do not know if it will help.
https://code.sololearn.com/ctaBYdlTM5rP/?ref=app