📄 test6.c
字号:
#include <stdlib.h>#include <stdio.h>#include <string.h>char msg[] = "realloc copies";void test(void){ char *p; p = malloc(10); strcpy(p, "Hello"); p = realloc(p, 20); if (strcmp(p, "Hello") == 0) printf(" OK\n"); else printf("fail\n");}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -