改变指针的值

时间:2008-05-21 05:46:53   来源:论坛整理  作者:  编辑:chinaitzhe
struct library *Borrow(struct library *head) /* 借书 */
{
struct library *p,*q;
char indexnum[9],st1[4]="out",st2[4]="in";
q=p=head;
Search(q);
printf("\nplease input the indexnum of you choose\n");
scanf("%s",indexnum);
while (p!=0)
{
if (strcmp(p->indexnum,indexnum)==0)
{ if (strcmp(p->state,st2)==0)
{
strcpy(p->state,st1);
return head; 我想在满足条件后改变链表中指针的值。 似乎这样不行。。。 有什么好的方法没啊
}
p=p->next;
}
}
if (p==0)
printf("cannot find the indexnum\n");
return head;
}
网友回复:这么复杂啊,不懂
网友回复:能否说的具体些
网友回复:链表中指针的值
具体指什么?
网友回复:要对结构中state值进行改变?
网友回复:具体点,也许能帮上忙。
网友回复:p->state是什么类型? 是指针就可以~

是把 p->state 中的 表示状态 in/out 改变?
网友回复:先说说为什么不行?
网友回复:呵呵 还是只能用枚举啊,,,,


还好搞定了。

谢谢大家啊
关键字:改变,指针,

文章评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面