I'm writing a function which compares the id of two vertices.
/* Returns whether aim and vertex have the same id */
bool id_eq(void *aim, void *vertex) {
if(*(Vertex)aim.id ==*(Vertex)vertex.id){
return true;
}
return false;
}
aim and vertex are two pointers of struct vertex_t.
typedef struct graph_t* Graph;
typedef struct vertex_t* Vertex;
/* A vertex is an id, a label and a list of incoming and outgoing edges */
struct vertex_t {
int id;
char *label;
/* A list of vertices representing incoming edges */
List in;
/* A List of vertices representing outgoing edges */
List out;
};
But when I compiled it, an error occurred as 'ERROR:request for member 'id' in something not a structure or union'. Could someone please tell me where I went wrong???