为什么此数组打印出数字而不是字符?

时间:2018-11-15 22:48:07

标签: arrays coordinates

我想使用字符作为字段来创建坐标系。 似乎控制台会给出一个恒定的数字数组,而不是一遍又一遍地显示相同的两个字符。 请帮助我,并提前致谢:)

也许这与溢出有关?一次又一次相同的数字

    char *reihe1[8]={"T","O","O","O","O","O","O","T"};
    char *reihe2[8]={"T","O","O","O","O","O","O","T"};
    char *reihe3[8]={"T","O","O","O","O","O","O","T"};
    char *reihe4[8]={"T","O","O","O","O","O","O","T"};
    char *reihe5[8]={"T","O","O","O","O","O","O","T"};
    char *reihe6[8]={"T","O","O","O","O","O","O","T"};
    char *reihe7[8]={"T","O","O","O","O","O","O","T"};
    char *reihe8[8]={"T","O","O","O","O","O","O","T"};
    for(int i = 0; i < 8; i++)
    {
    printf("[%s]", reihe1[i]);
    printf("[%d]", reihe2[i]);
    printf("[%d]", reihe3[i]);
    printf("[%d]", reihe4[i]);
    printf("[%d]", reihe5[i]);
    printf("[%d]", reihe6[i]);
    printf("[%d]", reihe7[i]);
    printf("[%d]", reihe8[i]);
    }

0 个答案:

没有答案