Home > Article > Backend Development > What is the method of defining string in C language?
#What is the method of defining strings in C language?
C language does not have a string type, so there is no way to define string variables.
1. But you can use character arrays to process strings.
Example: char a[] = "hello";
This defines a character array named a
2, which can also be used Define a pointer variable
Example: char *p = "hello";
Defines a pointer variable named p.
Recommended learning: c language video tutorial
The above is the detailed content of What is the method of defining string in C language?. For more information, please follow other related articles on the PHP Chinese website!