C语言day08-08字符串数组

pragma mark 字符串数组

pragma mark 概念

pragma mark 代码

#include 
int main()
{
    char name1[] = "lyh";
    char name2[] = "lyx";
    char name3[] = "lys";
    char name4[] = "lyt";

    // 如果向存储一堆字符串,那么可以使用字符串数组
    // 说白了字符串数组就是二维数组
    char names[5][20] =
    {
        "lyh",
        "lyx",
        "lys",
        "lyt",
        "ldf"
    };
    
    char names2[2][20] =
    {
        {'l','y','h','\0'},
        {'l','y','x','\0'}
    };
    return 0;
}


你可能感兴趣的:(C语言day08-08字符串数组)