You have to review a little the concepts in C, you have some "errinhos" in your code, such as:Variables p and c are declared as int, but in the code are used to save a word.When you use int, you are specifying that the variable will receive an entire number, i.e. you will not be able to save other types of data, and cannot save a word, for example.
For this you can specify a type variable char (string), which will save a total number of characters, for example:char variavel[50];
In the structure of if, you try to compare c directly with the word "Guerreiro".Even if you set the variable type to char(string), as in the above example and trying to make a if of direct comparison, would give "error", he will never enter the condition of if, since it is not possible to directly compare a type variable char(string). Except where char is used to save a single character, for example:#correto
char variavel;
variavel = 'a';
if(variavel == 'a');
#incorreto
char variavel[20];
variavel = "palavra";
if(variavel == "palavra");
When using only char variavel, you can save a single character, allowing you to make a comparison in a if normal with simple quotes 'a', but when used char variavel[20], you are declaring a string that can save a number of characters in it depending on the value you specify in the assignment.In this case the comparison is different, there is a function in the library <string.h> that makes this comparison, that function is strcmp(), that you can see a better explanation http://www.cplusplus.com/reference/cstring/strcmp/ . Basically, it returns a number depending on the situation of the comparison, and can check whether it is larger, equal or smaller:c = "variavel";
if(strcmp(c, "variavel") == 0); #a função retorna 0, pois são iguais
So you can make a comparison between two words.Use scanf() to read words.Although it works, it is not the best to use scanf() to read words, for he will not be able to read a compound name, for example:scanf("%s", variavel); #foi digitado o nome José Maria
printf("%s", variavel); #imprime somente o nome José
So, the most appropriate in this situation is to use the gets(), that will save everything that is typed, you can read more about it https://www.tutorialspoint.com/c_standard_library/c_function_gets.htm .Finally, but not least, is the complete code, of how it should be:#include <stdio.h>
#include <string.h>
main(){
char p[20];
char c[20];
printf("RPG TESTE\n");
printf("Digite um nome para o seu(a) personagem:");
fflush(stdin);
gets(p);
printf("\nEscolha uma classe, digitando entre Guerreiro ou Monge:");
fflush(stdin);
gets(c);
if(strcmp(c, "Guerreiro") == 0){
printf("\n\nGuerreiro");
}
else {
printf("\n\nMonge");
}
}