我读到这个:http ://www.drpaulcarter.com/cs/common-c-errors.php#2.8 并且有这样的代码块:
#include <string.h>
#include <stdlib.h>
int main()
{
char *st = malloc(20); /* st points to allocated array*/
strcpy(st, "abc"); /* st points to char array */
free(st); /* don't forget to deallocate when done! */
return 0;
}