Home  >  Article  >  Backend Development  >  What is the method of defining string in C language?

What is the method of defining string in C language?

angryTom
angryTomOriginal
2020-02-27 15:34:0620715browse

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!

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