为什么我不能在下面给出的代码之间 malloc 函数?PS:- 评论行



为什么我不能使用malloc函数在第四列表中声明新变量编译器给出一个错误"无法创建新节点"。

         while(a>0)
         {  struct node*newnode=(struct node*)malloc(sizeof(struct node*));
         printf("Enter the data in the noden");
         scanf("%d",&b);
         struct node*newnodee=(struct node*)malloc(sizeof(struct node*));
         newnode->data=b;

"#include studio.h>" #include stdlib.h>"

这些库应包含在您的文件中。

最新更新