简体   繁体   中英

What does "^L" mean in C?

For example, main in src/hello.c in the GNU Hello package ends like this:

   exit (EXIT_SUCCESS);
 }
 ^L

Literally, it's a page break ("form feed") character. The compiler treats it as ordinary whitespace. But it's very useful for printing source code - it starts a new page (for example, use ^L between functions to force each call to get its own page).

In Vim /vi based editors, you can insert such a character within edit mode by typing Ctrl + V followed by Ctrl + L . It will look like ^L in the editor, but it's actually just one character (ASCII value: 12 or 0x0C).

In other words, ^L does this:

it is also called form feed.It is a page-breaking ASCII control character. It forces the printer to eject the current page and to continue printing at the top of another. It will also cause a carriage return. The form feed character code is defined as 12 (0xC in hexadecimal)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM