Home>Article>Backend Development> How to define legal character constants in C language?

How to define legal character constants in C language?

尚
Original
2020-03-02 10:39:34 28698browse

How to define legal character constants in C language?

There are two forms of data representation in C language: one is constant and the other is variable. As the name suggests, constants are data that remain unchanged, and variables are data with variable values!

Recommended: "c Language Tutorial"

Let's take a look at how to define legal character constants in C language:

In C language , a character constant represents a character in the ASCII character set. The character constant occupies 4 bytes in the memory and stores the ASCII code (integer data) of the character.

In C language, a character constant represents a character in the ASCII character set. In the program, a character is enclosed in single quotes as a character constant.Uppercase and lowercase letters represent different word constants; so do spaces in single quotes; character constants can only contain one character; character constants can only be enclosed in parentheses.

For more programming related content, please pay attention to theProgramming Introductioncolumn on the php Chinese website!

The above is the detailed content of How to define legal character constants in C language?. 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