07/11/10 21:35:14
>>228
printf("type 'q' to exit\n");
while(fgets(buf, sizeof(buf), stdin)){
/* 改行コードを取り除く */
char* sep = rindex(buf,'\n');
if(!sep)
continue;
*sep = '\0';
if(!strcmp(buf, "q"))
break;
/* カンマまでをbufに格納 */
sep = rindex(buf, ',');
if(!sep)
continue;
*sep = '\0';
name = buf;
age = atoi(++sep);
head = addList(name, age, head);
}
何かあれば言ってちゃぶだい!