The idea of this method is to write all words from a list of nodes in a binary file. I have a linked list of nodes, where each node has two information, its information, and a reference to the next node in the list. The idea is to write the information of each node in a binary file. However, I'm getting the following error:
warning: incompatible pointer to integer conversion assigning to 'char' from 'const char *'
What happens in this line of code:
*pal = nodo->info;
I just do not understand what the problem is, since my structure defines the node information as a pointer as well. The following is the NODO framework code and the
typedef struct Temp{
char const *info;
struct Temp *prox;
}TNODOPAL;
Method:
void escreveBinario(){
TNODOPAL *nodo = inicioPal;
FILE *fp;
char *pal = NULL;
fp = fopen( "binary.dat" , "wb" );
if (fp == NULL) // Se não conseguiu criar
{
printf("Problemas na CRIACAO do arquivo\n");
return;
}
while(nodo != NULL){
*pal = nodo->info;
fwrite (&pal, sizeof(char) * 30, 200, fp);
nodo = nodo->prox;
}
fclose(fp);
}