I don't understand linked list very well and am a bit confused. I searched and tried to learn how to use them correctly on the internet, but I doubt this is correct.
I'm trying to get the program to make a linked list with, First name, last name, SSN, and DOB.
Any feedback on what to do, or help with code would be greatly appreciated.
if you know of a good tutorial on linked list, because I want to learn and understand them in greater depth, please share it with me.
thanks in advanced
Code:#include <stdio.h> #include <stdlib.h> #include <string.h> main() { struct student { char firstName[20]; char lastName[20]; int socialSecurity; int dob; student * next; }newStudent; structures student * temp; student * start; student * end; temp = new student; temp ->lastName[0] = 'Donald'; temp ->firstName[0] = 'Mat'; temp -> socialSecurity = 354-56-5632; temp -> dob = 10-18-87; temp ->next = NULL; start = temp; end = temp; temp -> next = start; temp = new student; temp ->lastName[0] = 'Brown'; temp ->firstName[0] = 'Tom'; temp -> socialSecurity = 352-33-5111; temp -> dob = 12-25-83; temp ->next = NULL; end ->next = temp; for(student *s = start; s; s = s->next) printf("name %s\n", s->lastName); system("pause"); }