问题如下:

VISUAL Studio2013提示malloc是未定义的标识符

解决:

加上#include "malloc.h"

  1. #include<stdio.h>  
  2. #include "malloc.h"  
  3. typedef char ElemType;  
  4. typedef struct BiNode{  
  5.     ElemType data;  
  6.     struct BiNode *lchild;  
  7.     struct BiNode *rchild;  
  8. }BiNode,*BiTree;  
  9. void preOrderCreateBiTree(){  
  10.     char ch;  
  11.     BiTree T;  
  12.     scanf("%c",&ch);  
  13.     if (ch=='#'){  
  14.         T = NULL;  
  15.     }  
  16.     else{  
  17.         T = (BiTree)malloc(sizeof(BiNode));  
  18.           
  19.     }  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-01-07
  • 2022-02-10
  • 2022-12-23
  • 2022-01-12
猜你喜欢
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-09-18
  • 2021-08-27
  • 2022-02-02
  • 2021-07-12
相关资源
相似解决方案