Hello all,
I'm trying to implement a linked list and enter data respectively. I've written a quite simple code for this. In the codes, I defined a struct (the node of the list) where the number and name of each will be held. The problem is, as starts at 23rd line here, in the for loop. I want the loop to iterate as i times the user entered, and ask for name & number at each. But that part doesn't work properly. Could you help me please, thanks in advance.
Seems like I've fixed the problem without knowing why I've done that :S I replaced
q -> name[MAX_LENGTH] with only q ->name and same for the number. So why it didn't work while it had the [MAX_NUMBER] part?
MAX_NUMBER and MAX_LENGTH are macros that translate into numbers when you compile your program. So by having that written inside of the brackets you were telling the system that you wanted that data at the end of the array.