Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, %-2d means dispersion.
In C language, %-2d means dispersion.
Hello: %d is a format controller in C language, which means to let the input-output function receive a plastic data.

%-2d: A minus sign indicates left alignment, for example:

1 2 3

Right alignment:

1 2 3

2 means that when the received shaping data is less than 2, it will be filled with spaces on the right.

take for example

printf("%-2d ", 100); Will output: 100

printf("%-6d ", 100); Will output: 100

-Technology Department of Internet of Things School-enterprise Alliance