This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error in compilation

hi i'm using Keil U vision IDE 3. i'm trying to implement my logic.
but it i'm receiving error as:
error: #513: a value of type "hc_ed *" cannot be assigned to an
entity of type "volatile ulong *"

when i implemented this code in turbo c i haven't recieved any error.

does any one know how to deal with this problem.

code is:

#include <stdio.h>
#include <stdlib.h>

typedef unsigned long int ulong;
typedef unsigned char uchar;
typedef struct _hc_controller_endpoint
{ volatile ulong control; volatile ulong cbp; volatile ulong *next_td; volatile ulong be;
}hc_ed,*phc_ed;

typedef struct _hcd_controller_endpoint
{ uchar error; uchar packet; volatile ulong status; hc_ed hced;
}hcd_ed,*phcd_ed;

int main(void)
{ int i; phcd_ed ed,trace; for (i=0;i<8;i++) { ed = malloc(sizeof(hcd_ed)); if(ed != NULL) { ed->hced.next_td =&(ed->hced); ed->status =(ulong) &(ed->hced); }
// i want to have address in same location.
//does there any other way to implement same logic }

}

0