|
出错提示:
Debug Assertion Failed!
Program:F:\kechen\cc作业\debug\ex.exe
File:dbgheap.c
Expression:_CrtIsValidHeapPointer(pUserData)
For information on how your program can cause an assertion
failure,see the Visual C++ document on asserts.
(press Retry to debug the application)
出错的语句在:
for 和 ++ --都没有错误的(之前有语句调用,并改变dp1 dp2的指针)
调试设断点在free句
- for(i=0;i<SIZE;i++){
- free(--dp1);
- free(dp1++);
- }
复制代码
dp1,dp2的申请函数:
- double * init(){
- double * dp;
- if((dp=(double *)malloc(SIZE*sizeof(double)))==NULL){
- printf("Can\'t malloc!");
- }
- return dp;
- }
复制代码
刚开始用VC不知是哪出错了……
在TC++3.0 生成的EXE文件运行不会出错,
VC生成的EXE文件运行后却出错。。。 |
|