Question
what's wrong with my code?????? #include #include #include #define MAXBINS 99 #define MAXCORS 26 #define MAXCUS 100 #define MAXPUR 10 /* datatype for a list
what's wrong with my code??????
#include
/* datatype for a list of orders ----------------- */
typedef struct { int bin_order_number; char bin_order_char; }bin_order; typedef struct { int orderNo; bin_order orderbin; }order; typedef struct { int cusnumber; int n; /* number of the orders what the txt include */ order oo[MAXPUR+1]; }customer; typedef struct{ int n; /*number of the customers */ customer cc[MAXCUS+1]; }orderlist_t;
int creatorderlist(orderlist_t *orderlist); void printorderlist(orderlist_t *orderlist, char *title);
int main(int argc, char *argv[]) { orderlist_t theorder; /*for stage 1*/ /* 1 ---------- creates the order list theorder */ creatorderlist(&theorder); /* 2 ---------- print the order list theorder */ printorderlist(&theorder,"STAGE 1"); /*for stage 2*/ return 0; }
int creatorderlist(orderlist_t *orderlist){ int i,p; int total_items=0; for(i=0; i
void printorderlist(orderlist_t *orderlist,char *title){ int i,p; /*firstly,print the tile and the header lines */ printf("%s ",title); printf("_______ "); printf(" orders: %d ",orderlist->n); printf(" items : %d ",creatorderlist(orderlist_t *orderlist)); /* then, print the order of each customer one by one*/ for(i=0;i
C: Users Alienware gcc -Wall -o ass2 ass2. c ass2.c: In function creatorderlist ass2. c:57:14: error oderlist" undeclared (first use in this function) for p 0 p oderlist->cc li n && scanf %d 9%d%s ass2. c:57:14: note: each undeclared identifier is reported only once for each function it appears in ass2. C In function printorderlist' ass2. c:77:42: error: expected expression before orderlist t printf items %d creatorderlist (orderlist t*orderlist ass2. 81 28: error: expected expression before orderlist t for (p 0:p creat orderlist (orderlist t *order list) p++ ass2. c:82:20: error: expected expression before orderlist t printf %d%s order list t- cs il. oo [pl orderb in. bin order number
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started