0
I need to put "10 car plates" on a chained list, only I’m having trouble putting something like char on that pointer, I even used the function strcpy
but is giving bugs...
strcpy(f->no, placaCarro)
, where placaCarro
is like char... so this is the problem, I don’t know if it’s very clear, but I hope you can help me...
Fila *criaFila(char *placaCarro){
Fila *f = (Fila*)malloc(sizeof(Fila));
f->no = placaCarro; //essa linha da erro, tentei usar strcpy aqui e não deu ...
f->proximo = NULL;
return f;
}
I want to put 10 car plates, and I wanted to put them on "we" each knot containing a plate, only I don’t know how to do that...
codes. c:8:11: Warning: assignment makes integer from Pointer without a cast [-Wint-Conversion] f->no = placaCarro; ^
You are giving this error by precisely not assigning the char to this pointer...
Wendel put all your code together in the question and comment on the line where is giving the error
– Luiz Augusto
What is the Queue structure? By any chance the element in is an integer?
– anonimo
what bug does on
strcpy
? How is this initializedplacaCarro
? how is this structureFila
?– Shinforinpola
Good afternoon Wendel, would post the code with the main, the struct and its function trying to be executed? would facilitate
– H.Lima
That, put the
struct
ofFila
. Thef->no
needs to be thechar*
for the operationf->no = placaCarro
work out.– Mauro Roberto