So folks, I created this struct
typedef struct{
int inicio;
int tamanho;
int fim;
char *elementos[50];
}Fila;
And I intend to create a vector of char, just as I created several times a vector of integers. But it is not working at the time of implementing the queue function.
Fila* criarFila(int tamanho){
Fila* novaFila = new Fila;
novaFila->tamanho = tamanho;
novaFila->inicio = -1;
novaFila->fim = -1;
novaFila->elementos = new char[tamanho];
return novaFila;
}
At compile time, I get the error:
listar.cpp:66:22: error: incompatible types in assignment of ‘char*’ to ‘char* [50]’
novaFila->elementos = new char[tamanho];
^
Does anyone understand why you are generating this error?