问题
在leecode做题遇到一个奇怪的问题:
就是链表反转的题,我本来以为很简单,但是while(head != NULL)这行代码报错
错误信息:Line 14: Char 16: runtime error: member access within misaligned address 0x000000000007 for type ‘ListNode’, which requires 8 byte alignment (ListNodeUtils.cpp)
代码:
ListNode* reverseList(ListNode* head) {
ListNode *rehead = NULL;
ListNode *tmp