The output makes no sense to me, am i recording the info into the struct wrong?
i changed from struct customer makeCustomer to void; the one that returns a customer outputs values just as weird, with no name output, time is 0, and items is a huge number
Code:
struct customer {
char name[30];
int items;
int time;
};
void makeCustomer(struct customer a,char n[30], int i, int t) {
strcpy(a.name,n);
a.items=i;
a.time=t;
}
int main() {
struct customer test;
char b[30];
b[0]='j';
b[1]='a';
b[2]='s';
int items=5;
int time=60;
makeCustomer(test,b,items,time);
printf("Name: %s--Items: %d--Time: %d\n",test.name,test.items,test.time);
system("pause");
}
OUTPUT: Name: H*b--Items: 236--Time: 4602016