One ,printf command

1. function

* Used to format data
2. Command format

* printf   ' Print format '    Actual content
Introduction to relevant formats

* \a: Output of warning sound
* \b: Backspace key
* \f: Clear screen
* \n: Wrap
* \r: enter key
* \t: Horizontal tab key
* \v: Vertical tab key
* \xNN:NN Is a number , Can convert hexadecimal numbers to characters
Related variable format

* %ns:n Is a number ,s Bit string . How many characters to output
* %ni:n Is a number ,i Is an integer . How many bit integer to output
* %N.nf:N,n It's all numbers .f Floating point .N Is the integer part number of digits ,n Is the number of decimal places ( decimal point . That's all )
3. Demo case

* Case 1 : Will be hexadecimal 45 Convert to ASCII Corresponding characters in the table

* Case 2 : For example, I don't have a file student.txt, The content of the document is . We want to use this document printf Print to screen

* ① We use %s\t Printing , But because English letters and numbers are not equal , It will cause the phenomenon of irregular sorting

* ② We use placeholders to sort the printed information ( Because the first line has English letters ,%i Warning will be given corresponding to letters , So remove Name That line )

Two ,pr command

1. function

* File print setup command
2. Command format

* pr  [ option ]  file name
3. Demo case

* pr   /etc/manpath.config
The top line , When printing documents , System displayed : time , file name , Page

Technology
©2019-2020 Toolsou All rights reserved,
( Super detail )Eclipse Using tutorials —— use Eclipse Create first HelloWorld! Database operation 5 code implementation mysql Addition, deletion, modification and query of database What can MCU do , Do you have any interesting works made by MCU or open source hardware Go to the interview after reading this , Steady over ~~ Single linked list of primary data structure (C Language implementation )SQL Comprehensive questions Employee unit comprehensive questions Python Implementation of Hanoi Tower code VHDL——JK trigger It's over , Starting salary 30k