求助:如何解决单向链表的删除函数出的问题?

删除函数出问题了……

#include <iostream>
#include <ctime>
#include <cstdlib>
#include <cstdio>
using namespace std;
struct node {
    int data;
    node *next;
};

int initialize(node *head, int datalist[]) {
    static int size = sizeof(datalist);
    static int n = 0;
    if(n>size)
        return 0;
    head->data = datalist[n];
    n++;
    head->next = new node;
    initialize(head->next,datalist);
    return 0;
}

int traversing(node *head) {
    static int size = sizeof(head);
    cout << head->data << ' ';
    size--;
    if(size<=0)
        return 0;
    traversing(head->next);
    return 0;
}

int deletenode(node *head, int data) { 这个函数有问题  
    static int size = sizeof(head);
    static int q = 1;
    if(q == 0)
            return 0;
    size--;
    if(size<=0)
        return 1;
    if(head->data == data)
    {
        head->data = head->next->data;
        node *box = head->next;
        head->next = head->next->next; 
        delete box;
        q = 0;
        return 0; 
    }else
    {
        deletenode(head->next, data);
        if(q == 0)
            return 0;
    }
}

int main() {
    srand(time(0));
    node *head = new node;
    int s[]={1,2,3,4,5,6,7,8};
    initialize(head, s);
    traversing(head);
    cout << "\n";
    deletenode(head,5);
    traversing(head);
    return 0;
}
def get_price(skuid):
url = "https://c0.3.cn/stock?skuId=" 
r = requests.get(url, verify=False)
content = r.content.decode('GBK')
matched = re.search(r'jQuery\d+\((.*)\)', content, re.M)
if matched:
    data = json.loads(matched.group(1))
    price = float(data["stock"]["jdPrice"]["p"])
    return price
return 0