Each array element is a string. You need to use char * when defining a string. Do you understand this?
When you define a string, you use char *a = "test"; right, then when you define a string array, the elements in the array are Not all should be of the char *a = "test";对吧, 那么当你定义一个字符串数组的时候,数组内的元素是不是应该都是char * type.
This is defining a string, you can view char *当成char as char (of course this is wrong, but in this case it will be better understood).
Or look at it like this, typedef char * string, then the definition becomes like this:
Each array element is a string. You need to use
char *
when defining a string. Do you understand this?When you define a string, you use
char *a = "test";
right,then when you define a string array, the elements in the array are Not all should be of the
char *a = "test";
对吧,那么当你定义一个字符串数组的时候,数组内的元素是不是应该都是
char *
type.This is defining a string, you can view
char *
当成char
aschar
(of course this is wrong, but in this case it will be better understood).Or look at it like this,
typedef char * string
, then the definition becomes like this: