Home  >  Article  >  Backend Development  >  What does putchar("\n") mean?

What does putchar("\n") mean?

angryTom
angryTomOriginal
2020-02-11 11:33:009908browse

What does putchar('\n') mean?

putchar('\n') means outputting a newline character, that is, realizing a carriage return Line break function.

Code analysis:

● putchar is a character output function, which can only output one character at a time. For example:

putchar('a'); // 输出字符'a'
putchar('abc'); // 输出字符'c' ,多个字符时输出最后一个字符

● '\n' is an escape character, representing a newline character

In C language, it starts with a backslash, followed by a character or a sequence of numbers To represent a character amount, called an escape character. There are mainly three forms:

1. Backslash followed by specific characters, such as '\n'

2. Backslash followed by 1 to 3 octal digits, such as ' \101'

3. A backslash followed by 1~2 hexadecimal digits (starting with x), such as '\x1A'

Recommended learning: c language video Tutorial

The above is the detailed content of What does putchar("\n") mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn