Miles Miles - 1 month ago 5
C Question

ergo wergo weigo

/* patch.hoc
v. 1.2 10/19/2001 NTC
*/
load_file("nrngui.hoc")
create soma // model topology
access soma // default section = soma

soma {
diam = 10 // soma dimensions in um
L = 10/PI // surface area = 100 um^2
}

Answer

You're assigning a variable of type struct ListNode to a variable of type struct ListNode *. It looks like you want to assign the address of the struct to the pointer, not the struct it self.

Try this:

n1.next = &n2;
n2.next = &n3;
n3.next = &n4;