/* C Structure Lab */ #include /* A list structure holds an array of up to 10 integers, n is the number of integers in the list. */ typedef struct list { int vals[10]; int n; } list; /* listsum returns the sum of a list you need to write this! (in assembly). */ int listsum(list *l) { /* your code goes here */ return(0); } /* Harder version (optional) - the parameter is an actual struct (not a pointer to a struct). Use gcc to see what is passed and how! int lsum(list l) { return(0); } */ int main(){ int i; list x; for (i=0;i<5;i++) x.vals[i]=i; x.n=5; printf("Sum of list is %d\n", listsum(&x)); /* call to optional function printf("Sum of list is %d\n", lsum(x)); */ return(1); }