error C2440: '=' : cannot convert from 'void&n C语言
2015-07-03 14:21
405 查看
异常:error C2440: '=' : cannotconvert from 'void *' to 'struct _Grafo*' Conversion from 'void*' to pointer to non-'void' requires anexplicit cast
void Insert1(struct BTreeNode** BST, ElemType x)
{ if (*BST==NULL) //在为空指针的位置链接新结点
{ struct BTreeNode* p = malloc(sizeof(structBTreeNode));
p->data = x; p->left =p->right = NULL; *BST = p; }
这是个例子,只需要
struct BTreeNode* p = (structBTreeNode*)malloc(sizeof(struct BTreeNode));即可。
void Insert1(struct BTreeNode** BST, ElemType x)
{ if (*BST==NULL) //在为空指针的位置链接新结点
{ struct BTreeNode* p = malloc(sizeof(structBTreeNode));
p->data = x; p->left =p->right = NULL; *BST = p; }
这是个例子,只需要
struct BTreeNode* p = (structBTreeNode*)malloc(sizeof(struct BTreeNode));即可。
相关文章推荐
- c++ stl
- C++ string
- C++ I/O
- C++关键字
- C++标准库(预处理器)
- Effective C++学习笔记(Part One:Item 1-4)
- (C/C++)register关键字
- C语言排序:冒泡排序
- 【C语言的日常实践(十四)】constkeyword详细解释
- 将C#程序与调用的dll对应的C++源码联调的一种方法
- C语言函数指针实现接口思想
- 【C语言的日常实践(十二)】命令行参数
- 成C++应用程序世界------异常处理
- c++中const的各种用法
- 求矩阵之和c++
- C++ 字典排序 原理与实现
- C语言中联合体union的使用
- nes模拟器C++源码
- 【C语言】写一个函数,实现字符串内单词逆序
- 在Windows下用C++扩展PHP