Jump to content

warning: initialization from incompatible pointer type


Recommended Posts

Posted

Boas,

Eu tenho a seguinte estrutura num header file :

typedef struct qtnode {
    struct QTnode *firstChild; 
    struct QTnode *secondChild;
    struct QTnode *thirdChild;
    struct QTnode *fourthChild;
    int xMin;
    int xMax;
    int yMin;
    int yMax;
    List l; //Lista de Rectangulos inseridos no nó

} QTNODE,*QuadTree;

No respectivo ficheiro c eu estou a construir uma função onde pretende preencher uma quadtree:

void genQuadTree(List lRect, int xMinimum, int xMaximum, int yMinimum,
	int yMaximum) {

QuadTree q = malloc(sizeof(QTNODE));

QTNODE *qFirst = q->firstChild;
QTNODE *qSecond = q->secondChild;
QTNODE *qThird = q->thirdChild;
QTNODE *qFourth = q->fourthChild;

o problema é que o compilador diz me que "QuadTree.c:70: warning: initialization from incompatible pointer type" que corresponde aquelas ultimas 4 linhas de codigo. Se me pudessem ajudar a descobrir como poderia resolver o erro agradecia bastante.

cumprimentos

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.