代码拉取完成,页面将自动刷新
#include "lwheap_port.h"
#include "lwheap.h"
int main()
{
lwheap_initial();
printf("free size: %d\n", lwheap_get_freesize(&__heap));
char* s0 = (char*)lw_malloc(30);
printf("free size: %d\n", lwheap_get_freesize(&__heap));
char* s1 = (char*)lw_malloc(20);
printf("free size: %d\n", lwheap_get_freesize(&__heap));
char* s2 = (char*)lw_malloc(50);
printf("free size: %d\n", lwheap_get_freesize(&__heap));
strcpy(s0, "Hello ");
strcpy(s1, "world!");
strcpy(s2, s0);
strcat(s2, s1);
strcat(s2, "\n");
printf(s2);
lw_free(s0);
printf("free size: %d\n", lwheap_get_freesize(&__heap));
lw_free(s1);
printf("free size: %d\n", lwheap_get_freesize(&__heap));
lw_free(s2);
printf("free size: %d\n", lwheap_get_freesize(&__heap));
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。