📄 malloc.c
字号:
#include <stdlib.h>
#include <stdio.h>
int main( void )
{
/* allocate memory for a 100-character string */
char *str;
str = (char *) malloc(100);
if (str == NULL)
{
printf( "Not enough memory to allocate buffer\n");
exit(1);
}
printf( "String was allocated!\n" );
free(str);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -