9. C language format controller / place holder

Time:2020-9-11

The Internet has such a paragraph:

If a boy has no partner –single af

If a girl has no partner –Go Believe

 

Whether it’s a single dog or a dog, it always corresponds to a type. In the previous article, we also introduced that variable types in C language include shaping, floating-point numbers, strings, arrays In fact, they all have their own place holders!

 

%d: used to output signed decimal integers (includingint/charType)

%u: used to output signed decimal integers (includingint/charType)

%o: used to output an unsigned octal integer

%x: used to output an unsigned hexadecimal integer

%c: used to output a single character

%s: used to output a string

%f: decimal floating-point number used to output decimal form (decimal form and exponential form can be recognized when input)

%e: used to output decimal floating-point numbers in exponential form (both decimal and exponential forms can be recognized when input)

%g: used to output the shorter decimal floating point number between exponential form and decimal form (both decimal form and exponential form can be recognized when input)

 

In the output controller,%d%f%s%cIs the most commonly used, they are output integersint, floating point numberfloat/double, strings, and characters. We can use it in the next articleprintfFunction to do the test separately!

 

 

 

 

Guess you like it:

1. Install visual studio 2015

2. Install visual studio plug-in visual assist

3. Set visual studio font / background / line number

4. C language variable type

5. C / C + + variable naming – Hungarian nomenclature

 

Reprint please note: ape programming " C language tutorial " C language format controller / place holder

Please contact the blogger directly for technical exchange and business cooperation

Scan code or search: ape programming

python/C++教程

Ape programming

WeChat official account swept the attention