I have a problem with the definition and creation of data structures to use trees. The structures that I must use if or if and should not change is the following:
#define INT 1024
#define CHAR 1025
#define STRING 1032
#define LIST 1033
#define SET 1034
typedef struct dataType* dataPtr;
typedef struct stringType* stringPtr;
typedef struct charType* charPtr;
struct dataType{
int nodeType;
dataPtr dato;
dataPtr sig;
};
struct stringType{
int nodeType;
char valor;
};
struct charType{
int nodeType;
char valor;
};
When I am going to create the tree as follows:
dataPtr aux;
aux=(dataPtr*)malloc(sizeof(dataPtr));
And when I try the function in the main (that is, when compiling) I get the Windows error and this suggestion:
"return from incompatible pointer type [-Wincompatible-pointer-types]"
Does anyone know how I can solve it?