I have this assignment and am trying to just first get my input correct. I can't seem to get the int input right. I posted earlier and have read the FAQs, but can't seem to get it. I keep getting:
a8.c: In function `main':
a8.c:22: warning: int format, different type arg (arg 2)
Here's my code so far:
Any help would...help. Thanks.Code:#include <stdio.h> struct info_struct { short int id; char *name; } members[10]; int main (void) { int i, j; for (i=0; i<10; i++) { printf("Please enter name: "); gets(members[i].name); printf("Please enter ID: "); scanf("%d", &members[i].id); } for (j=0; j<10; j++) { printf("%d, %s\n", members[j].id, members[j].name); } return 0; }



LinkBack URL
About LinkBacks



Good luck with the rest, don't hesitate to come back and ask more questions and I was glad to be of help. 