【发布时间】:2020-06-18 16:44:11
【问题描述】:
struct ListNode {
int val;
struct ListNode *next;
};
struct ListNode* test = malloc(sizeof(struct ListNode*));
test->val = 6;
struct ListNode* lex = malloc(sizeof(struct ListNode*));
test->next = lex;
return test;
此时我应该收到一个填充的结构。相反,我得到了这个:
Line 14: Char 18: runtime
error: store to address
0x602000000118 with
insufficient space for an
object of type 'struct ListNode
*' (solution.c)
0x602000000118: note: pointer
points here
be be be be 00 00 00 00 00 00
00 00 02 00 00 00 ff ff ff 02
08 00 00 20 01 00 80 70 be be
be be
这是怎么回事?
【问题讨论】: