I'm trying to pass a pointer to a struct over to a separate function. But when I go to compile, I get warning: passing argument 1 of 'build_network_state' from incompatible pointer type
This is in a helper function the compiles into my program:
typedef struct router {
int num;
char label[64];
Topology *topology;
} Router;
This is from the .c file:
void build_network_state(Router *ptr) {
fprintf(stdout, "Hello from router %s\n", ptr->label);
}
int main(int argc, char *argv[]) {
Router* this_router = malloc(sizeof(Router));
...
fprintf(stdout, "test: %s\n", this_router->label); // output looks fine if I comment the next line
build_network_state(&this_router);
}