D
drhowarddrfine
I'm playing around with data passed in a structure. In one function I
do this:
/* path is defined as char* path[10] in the struct */
struct request customer_request;
if(strcmp("order",customer_request->path[0])==0)
order(customer_request);
In the called 'order' routine, I do this:
void order(struct request *customer_request){
if(strcmp("menu",customer_request->path[1])==0)
menu(customer_request);
but I get a compiler error:
warning: passing arg 1 of `menu' from incompatible pointer type
do this:
/* path is defined as char* path[10] in the struct */
struct request customer_request;
if(strcmp("order",customer_request->path[0])==0)
order(customer_request);
In the called 'order' routine, I do this:
void order(struct request *customer_request){
if(strcmp("menu",customer_request->path[1])==0)
menu(customer_request);
but I get a compiler error:
warning: passing arg 1 of `menu' from incompatible pointer type