What is the method of defining string in C language?

angryTom
Release: 2020-02-27 15:34:06
Original
20732 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template