为什么cygwin下运行释放内存释放错误的程序不报运行时错误?
下面这段程序在VS2005下会报一个运行时错误,原因是内存释放错误, 但Cygwin下为什么运行可以安全通过?
100分相送,期待高手解答.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct A
{
int a;
char b;
};
struct B
{
int a;
char b;
int c;
};
int main(void )
{
A *a = NULL;
a = (A*) malloc(sizeof(A));
memset(a, 0, sizeof(B));
free(a);
printf("helloWOrld");
}
100分相送,期待高手解答.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct A
{
int a;
char b;
};
struct B
{
int a;
char b;
int c;
};
int main(void )
{
A *a = NULL;
a = (A*) malloc(sizeof(A));
memset(a, 0, sizeof(B));
free(a);
printf("helloWOrld");
}
...全文
相关推荐
Cygwin错误调试
Cygwin错误调试!包含nutch、solr集成所有报错问题单及原因。个人版
Cygwin 下的NS3安装心得
此文档是自己在安装windows下你用cygwin构造的虚拟环境下进行ns3的安装心得,不知道是不是适合你的那份,但是不管怎么样,请记住一定要把需要的插件安装完整,否则错误很多,也不易查找
cygwin1.dll
cygwin1.dll windows下 的 使用 是缺少cygwin1.dll的解决方法,下载此附件即可
altera_quartus13.1_cygwin_patch.zip
解决nios开发过程中eclipse出现的 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer的包文件
threadx cygwin skyeye基于2410
在cygwin上基于skyeye的2410 移植threadx。解决之前栈错误,完美运行。


