HEAPNODE.C
资源名称:C.rar [点击查看]
上传用户:qq5388545
上传日期:2022-07-04
资源大小:29849k
文件大小:1k
源码类别:
界面编程
开发平台:
C/C++
- #include <stdio.h>
- #include <alloc.h>
- void main(void)
- {
- char *buffer, *second_buffer;
- int i, state;
- buffer = malloc(100);
- second_buffer = malloc(100);
- state = heapchecknode(buffer);
- if (state == _USEDENTRY)
- printf("buffer is okn");
- else
- printf("buffer is not okn");
- state = heapchecknode(second_buffer);
- if (state == _USEDENTRY)
- printf("second_buffer is okn");
- else
- printf("second_buffer is not okn");
- for (i = 0; i <= 100; i++)
- buffer[i] = i;
- state = heapchecknode(buffer);
- if (state == _USEDENTRY)
- printf("buffer is okn");
- else
- printf("buffer is not okn");
- state = heapchecknode(second_buffer);
- if (state == _USEDENTRY)
- printf("second_buffer is okn");
- printf("second_buffer is not okn");
- }