C言語なら俺に聞け(入門編)Part 104at TECH
C言語なら俺に聞け(入門編)Part 104 - 暇つぶし2ch142:デフォルトの名無しさん
12/07/23 22:52:42.03
すみません、どうしても解答がわからないのですが...

問.関数、void addlist(LIST *head,LIST *addata)を完成させろ

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

typedef struct name_list{
struct name_list *next;
char *name;
}LIST;
void addlist(LIST *head, LIST *addata);
int main(void){
LIST name0= {NULL, NULL};
LIST name1= {NULL, "B"};
LIST name2={NULL, "C"};
LIST name3={NULL, "D"};
LIST name4={NULL, "E"};
LIST addata = {NULL, "A"};
LIST *p;
LIST *head;

head=&name0; name0.next=&name1; name1.next=&name2; name2.next=&name3; name3.next=&name4;
addlist(head, &addata);

for(p = head->next; p != NULL;p=p->next)printf("%s\n,p->name");


どなたかお願い致します....(ノД`)


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch