编译时通过,运行时出现了错误信息“..._CrtIsValidHeapPointer(pUserData)...”
编译时通过,运行时出现了错误信息
"
Debug Assertion Failed!
Program:D:\ds\\c02Debug\11.exe
File:dbgheap.c
Line:622
Expression: _CrtIsValidHeapPointer(pUserData)
For information on how your Program can cause an assertion
failure,see the Visual C++ documentation on awwerts.
.......
"
我用的是vc6,编译的程序源文件是
-------------------------
…………
typedef struct SqList{
int *elem;
int length;
int listsize;
}SqList;
int Insert(SqList &l ,int x){
int i,j;
int *newbase;
if(l.listsize<=l.length){
newbase=(int*)realloc(l.elem,(l.listsize+LISTINCREMENT)*sizeof(int));//好像是这句出了问题
if(!newbase)exit(-1);
l.elem=newbase;l.listsize+=LISTINCREMENT;
}
…………
--------------------------
请问大侠们是什么原因啊,小弟初学数据结构