What is a string type
Question 1: What is the type of string constant? A string constant is a string, which is the value of a char array.

Char * a = abcd This is a statement. Declaring a is a char pointer, and = ABCD is initialization, which is equivalent to dynamically allocating 5 memory cells. At this time, a can be regarded as a char array, char a [5]; The array contains abcd and string terminator \0.

Not "const pointer", const pointer is a const pointer, which is another concept.

Where char * a = ABCD if there is one in the statement: a [1] =' z'; Then printf(%s, a); Print out azcd.

Z' is an integer of 1 byte, and an array of type char can be regarded as an integer array of 1 byte:

char a[ 1]= { ' z ' }; Declaration and initialization

char a[4]={'a ',' b ',' c ',' d ' }; Declaration and initialization

Question 2: What does the string type mean? It's just one type.

For example, int is an integer, float is a floating point and char is a character.

In c++, there is a special string type->; line

In C, both character arrays and character pointers can handle strings.

If "haha" is a string, it can be declared as follows.

Char a[] = haha; or

Char* a = haha;

Question 3: What is a personality type? All character types should be quoted. For example, 123, the name abc and so on are all numerical types, that is, 1234. The logical types of these numbers are divided into logical true and logical false date types, that is, [09-0 1-02] to represent time.

Question 4: Ask! What does character mean? What about character types and strings? Can you explain it to me? Text, everything that represents the hunger of a text, is the most basic unit or element of a text.

Related to the role of the same level are images,

All programming languages and files are composed of characters.

A string refers to a single element composed of multiple characters * * *.

Character type is the classification of characters under all conditions. For example, in programming languages,

Generally, user-defined elements are treated as characters. Such a character type,

Character types can be variables, symbols, letters, numbers, binary, files and so on.

These types of definitions can cross and include each other.

Question 5: What do you mean by personality type? A character type is a string consisting of letters, numbers and specified symbols. It can be a single letter, number and symbol that needs to be quoted. Can be compared with the numerical type. According to different languages, the corresponding character types and ranges are different. Such as string type in java, char and varchar in sqlserver. Char and varchar2 in oracle are all character types.

Question 6: What is the type of class? What is the type of array? What is the type of string? Array type: data organized by several elements with the same basic type. They have a sequential order and can also be accessed in this order. For example, int a[ 10], * * has 10 elements, and the first element is of the same type and is an integer. The elements of 10 are a[0], a[ 1], a[2], a[3], a[4], a[5], a[6], a[7], a[8] and a[9] respectively. But int a, b, c, d; The variables defined in this way, a, b, c and d, have no order.

All basic types can be used as array types, such as int, long, float, double, char and so on.

Structure struct can also be used as an array type. Various types of pointers can also be used as array types.

Question 7: What is a numeric string? A numeric string can be understood as a string containing an int value. At this point, a string is called a numeric string. Example: 23 23 The former is a string with two quotation marks, and the value inside is int, so it is a numeric string, while the latter is directly int.

Question 8: What do you mean by integer, real and character? Integer is an integer, which is divided into long shaping and short shaping, with 32 bits and 16 bits respectively. Dan showed different ranges of figures. If it is an unsigned integer, it can only represent positive integers. A signed integer that can represent positive and negative integers.

The real type is actually a floating-point number, which is divided into single-precision floating-point number and double-precision floating-point number, which are 32 bits and 64 bits long respectively. Represents different ranges of numbers.

The character type is an 8-bit integer. If it is an unsigned character type, it can only represent positive integers between 0 and 255. Signed integer, which can represent positive and negative integers between-128 and 127. ASCII characters can be represented by character types.

Question 9: What is a character variable? Character variables are variables used to store a single character, such as char a =' a and string is a variable used to protect multiple characters. In C language, a string is represented by an array of characters, such as charname[]= {abcdefghikllll}. The difference between a character and a string is whether to use double quotes or single quotes. Double quotation marks represent strings and single quotation marks represent characters, such as: a and' a'. The first is a string, and the second is a character.

Question 10: How to judge a string one by one? What kind of characters read each character circularly, and then make conditional judgment, divide it into uppercase English letters, lowercase letters, numbers and other characters, and output uppercase letters, lowercase letters, numbers and other characters respectively. Copy the source program.

# include # include # include int main(){ char ch[ 100]; int I; Int length; Printf (please enter a string: \ n); scanf(%s,ch); length = strlen(ch); Printf (length %d\n, length); for(I = 0; I =' A '){ printf(% d characters are capital letters \n, I+1); } else {if(ch[I]=' a '){ printf(% d characters are lowercase letters \n, I+1); } else {if(ch[I]=' 0 '){ printf(% d character is digit\n, I+1); } else {printf(% d character is other characters \n, I+1); }}} returns 0; } operation results, if there is anything you don't understand, you can also ask me.