📄 malloc.c
字号:
#include <string.h>
#include <alloc.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
char *str;
str=(char *)malloc(20);
if (str==NULL)
{
printf("out of memory\n");
exit(0);
}
strcpy(str,"dynamic memory");
printf("%s\n",str);
free(str);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -