(・∀・)C/C++の宿題やらせてください。ver10
■ このスレッドは過去ログ倉庫に格納されています
0453448
NGNG次に、初期化。
そして、挿入。
dekiteiruつもりなんですが・・・。
struct node
{
int key;
struct node *next;
};
struct node *head, *tail;
void listinitialize(void)
{
head = (struct node*) malloc(sizeof(*head));
tail = (struct node*) malloc(sizeof(*tail));
head->next = tail;
tail->next = NULL;
};
struct node *insertafter(int v, struct node *p)
{
struct node *x;
x = (struct node*) malloc(sizeof(*x));
x->key = v;
x->next = p->next;
p->next = x;
return x;
};
■ このスレッドは過去ログ倉庫に格納されています