What are all them character formatting things for? I mean those flags after the string output. What are they used for? I don't understand them.
Printable View
What are all them character formatting things for? I mean those flags after the string output. What are they used for? I don't understand them.
Do you mean, right, left, setw(n), setfill(), setprecision, etc?
int integer = 10;
float _float = 2.5
char string[] = foo;
printf("%d is an integer\n%f is a float\n%s is a string", integer, _float, string);
Output:
10 is an integer
2.5 is a float
foo is a string
For more information, go here.
-Prelude