ntk*_*138 0 c malloc free memory-leaks
我是 C 新手。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void demo() {
char* s = malloc(10);
strcpy(s, "foo");
free(s);
}
int main()
{
demo();
}
Run Code Online (Sandbox Code Playgroud)
这个程序会泄漏几个字节的内存吗?