c - Why are the values of a struct corrupted after the struct is initialized? -
i trying initialize array of structs values, cannot values stay constant. use initial loop retrieve values string , assign them struct in array. once try iterate through array loop, of values not same. this code in question: void printorder(order *node) { printf("title is: %s\n",node->title); printf("price is: $%f\n",node->price); printf("id is: %d\n",node->custid); printf("category is: %s\n",node->category); } void initorder(order *neworder, char *title, double price, int custid, char *category) { neworder->title = title; neworder->price = price; neworder->custid = custid; neworder->category = category; neworder->next = null; printf("new order object initialized\n"); } char *title; char *pricetemp; char *idtemp; char *category; order localorders[numorders]; // num...