There is probably a simple answer to this but i'm having trouble displaying what i've input into a record (using linked lists). To start at the beginning, i'm designing a simple program that uses a single linked list (slightly pointless in my opinion but its what i'm being asked to do) that saves only 1 record...
For example, i read in age...
But when i come to display the age again, it gives me a 6 digit number.
Is the number i'm seeing a memory reference? If so, how can i get it to output the right result? If not, where am i going wrong?
Code:
typedef struct
{
char name[36];
unsigned int age[3];
char gender[2];
char department[20];
char modules[10];
unsigned int measure[2];
} Lecturer;
For example, i read in age...
Code:
printf("Age: \n");
scanf("%d", current->person.age);
But when i come to display the age again, it gives me a 6 digit number.
Code:
printf("Age: %d \n", lecturer->person.age);
Is the number i'm seeing a memory reference? If so, how can i get it to output the right result? If not, where am i going wrong?