D
drhowarddrfine
Is there a better way to do this? At the end of this code, instead of
copying all the pointers from milk[0] to my_milk[0], and so on, I'm
sure there is a way to just make my_milk[]=milk[]?
typedef char *Milk[2];
typedef char *Bread[2];
Milk milk[]={
white, chocolate
};
Bread bread[]={
white,wheat
};
struct Groceries{
Milk my_milk;
Bread my_bread;
}
struct Groceries my_orders[10];
my_orders[0].my_milk[0]=milk[0];
my_orders[0].my_milk[1]=milk[1];
copying all the pointers from milk[0] to my_milk[0], and so on, I'm
sure there is a way to just make my_milk[]=milk[]?
typedef char *Milk[2];
typedef char *Bread[2];
Milk milk[]={
white, chocolate
};
Bread bread[]={
white,wheat
};
struct Groceries{
Milk my_milk;
Bread my_bread;
}
struct Groceries my_orders[10];
my_orders[0].my_milk[0]=milk[0];
my_orders[0].my_milk[1]=milk[1];