Dude basically you can’t do that with a char
"normal", a variable of this type is made to store only one character, so you can store a string (string) in a variable it is necessary that you use a string, this would be equivalent to an array (array) of type char
in C.
To declare a string is very easy, you first need to keep in mind how many letters the word you want to store has, after that just declare the variable equal you would declare an array, only using char
of course, it is very important to note that at the end of all the string will characterize you ' 0', this symbolizes that your string has reached the end, just when you count how many letters the word you want to store has, to be able to create the string, remember to always add an al to the final result, this will be reserved to ' 0'.
ex:
#include <stdio.h>
int main ()
{
char strNumPlaca[50] = "ABC - 03257";
printf("%s", strNumPlaca); /* use %s ao invés de %c, pois isso simboliza
que você esta utilizando uma string. */
return 0;
}
To help in your understanding here is a link:
http://linguagemc.com.br/string-em-c-vetor-de-caracteres/
So we can help you, provide a Minimum, Complete and Verifiable code.
– NoobSaibot
blz I’ll change the question
– aluno00
From what you’re saying, it seems to be the case mark an answer as accepted. Here we do not write "solved" in the question. If you have an answer that really helped you, mark it as accepted. If you came to the solution on your own, put in the solution as an answer. So content is more organized and easier to find in the future by other people with similar problems.
– Jefferson Quesado