Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language definition character
C language definition character
This is a variable with a defined character type.

Char is used to define character variables in C or C++, occupying only one byte, and the range of values is-128 ~+127 (-2 7 ~ 2 7-1). C languages such as int, long, short, etc. When signed or unsigned is not specified, it is signed by default, but char does not specify signed or unsigned in the standard, and the compiler can compile with or without sign.

A string represented by a fixed length of a specified length; For example, char(8), the database will store data with fixed 1 byte (eight bits), and strings with less than eight bits will be filled with spaces. In excel, the char function is used to return the characters corresponding to numeric codes.

Extended data:

Related contents of C language:

The data types of 1 and c include integer, character, real number or floating point (single precision and double precision), enumeration, array, structure, * * * * user, pointer and null.

2. The amount by which the value of the identifier can be changed. An identifier is a series of letters, numbers or underscores that begin with a letter or underscore. Please note that the first character must be a letter or an underscore, otherwise it is an illegal variable name. Variables are assigned corresponding storage locations at compile time.

3. If the variable name is followed by a number bracket, the declaration is an array declaration. Strings are also arrays. They end the array with ASCII NULL. It should be noted that the index values in parentheses are counted from 0.

Baidu encyclopedia -char