What does putchar('\n') mean?

angryTom
Release: 2020-02-11 11:33:00
Original
9994 people have browsed it

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' ,多个字符时输出最后一个字符
Copy after login

● '\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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template