在Leetcode写反转链表时遇到了我看不懂的报错
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
struct ListNode* reverseList(struct ListNode* head){
if(head==NULL)
return head;
struct ListNode* cout[1000];
int i=0;
struct ListNode* p=head;
struct ListNode* wei=NULL;
while(p->next!=NULL)
{
cout[i++]=p;
p=p->next;
}
wei=p;
while(i>=0)
{
i--;
p->next=cout[i];
p=p->next;
}
return wei;