lichking 发表于 2017-7-22 14:37:31

s1e8

char 变量名[数量];
变量名[索引号] = 字符;
声明字符串
        char name;
给字符串赋值:
        name = 'F';
        name = 'i';
        name = 's';
        name = 'h';
        name = 'C';

定义字符串:
        char name = {'F','i','s','h','C'};


字符串结束要以\0结尾

        char name[] = {"......"};
        char name[] = {'F','i','s','h','C','\0'};

字符串常量是可以写成: char name[] = "FishC";
页: [1]
查看完整版本: s1e8