entire printf% s in C [duplicate]

0

I'm trying to get all the characters in the string to appear on the screen [0], but only the last letter of the string is coming out, does anyone help me with what I'm missing?

#include <stdio.h>
#include <stdlib.h>
#include <locale.h>

char tipoPersonagem[3][100] = {{'Lutador'}, {'Ninja'}, {'Apelão'}};

int main()
{
    //Definição para acentos e cedilha
    setlocale(LC_ALL, "Portuguese");

    printf("%s.", tipoPersonagem[0]);

    return 0;
}
    
asked by anonymous 29.05.2018 / 23:36

1 answer

1

Strings in C are set to " (double quotes), while ' (single quotes) are used to represent > a character , so the code is:

char tipoPersonagem[3][100] = {{"Lutador"}, {"Ninja"}, {"Apelão"}};
    
29.05.2018 / 23:41