例1-1.c

来自「一些基本函数的程序源代码:包括(1)malloc函数(2)free函数(3)re」· C语言 代码 · 共 17 行

C
17
字号
/* Note:Your choice is C IDE */
#include <stdio.h>
#include <stdlib.h>
main()
{
    char * str;
    if((str=(char *)malloc(50))==NULL)
	{
      printf("\n No enough memory to allocata for the string.");
      exit(1);
	}
printf("\n Input the string:");
	gets(str);
	puts(str);
	     free(str);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?