本文介绍了使用libary分配和释放指针的内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
动态库代码:
Dynamic lib code:
DYNAMICLIB_API int* aa1(void)
{
int *a1;
a1=(int*)malloc(sizeof(int));
printf("Interger created\n");
printf("bye");
printf("good");
printf("memory created");
return a1;
}
我的主要功能代码:
my main function code:
int main(int argc, char* argv[])
{
int *a1;
a1=aa1();
printf("Hello World!\n");
free(a1);
return 0;
}
代码产生运行时错误可以为您提供帮助.
that codeproducing run time error can you help me.
推荐答案
这篇关于使用libary分配和释放指针的内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!