这个是我自己实现的一个带头节点的单链表: #include <malloc.h> #include <stdio.h> #include <stdlib.h> #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define OVERFLOW -2 typedef int Status; typedef int ElemType; typedef struct LNode { ElemType e ...
先来看一段代码: #include <stdlib.h> void main() {   char* p;   char* q;   p = (char*)malloc(sizeof(char) * 4);   q = p;   p = (char*)malloc(sizeof(char) * 8);   free(q);   free(p); }   这一段代码在Visual Studio 2008下编译通过,但是运行时出现错误:_CrtIsValidHeapPointer(pUserData)。从信息上理解就是引用了不可用的 ...
shared
搜索本博客
最近加入圈子
最新评论