You have undefined behavior here. malloc will allocate 8 bytes (as you say), but this cast is "bad": ptr = (struct node*)malloc(sizeof (ptr));.
確定! 回上一頁