问题描述
- 帮我看看这段代码哪里出错啦,帮我改改可好,谢谢啦
- /* Note:Your choice is C IDE */
#include
#include
#include
typedef struct Node
{
int data;
struct Node *pNext;
}NODE *PNODE;
PNODE create_list(void)
void main()
{
PNODE PHead=NULL;
pHead create_list();}
PNODE create_list(void)
{
int i;
int len;
int val;
PNODE pHead=(PNODE)malloc(sizeof(NODE));
if(NULL==pHead)
{
printf(""shibai"");
exit(-1);
}
printf(""len="");
scanf(""%d""&len);
for(i=0;i {
printf(""di %d ge jiedian=""i+1)
scanf(""%d""val);
PNODE PNew=(PNODE)malloc(sizeof(NODE));
if(NULL==pNew)
{
printf(""shibai"");
exit(-1);
}
pNew->data=val;
pHead->pNext=pNew;
pNew->pMext=NULL;
}
return pHead;
}
解决方案
时间: 2024-09-10 15:55:10