I thought I could access member "data" in the "next" node of a linked list with:
node->next->data
but I seem to be getting a segfault, could that be the reason?
Am I wrong?
I thought I could access member "data" in the "next" node of a linked list with:
node->next->data
but I seem to be getting a segfault, could that be the reason?
Am I wrong?
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Obviously, if the next pointer is NULL, you can expect a seg-fault. Other reasons may exist too.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
I suppose I should be glad that's the answer.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge