摘要: 今天在stackoverflow上看到有一个这样提问说下面这段程序第二个输出语句有问题#include <stdio.h>#include <stdlib.h>#include <string.h>class C {public: char* s; C(char* s_) { s=(char *)calloc(strlen(s_)+1,1); strcpy(s,s_); }; ~C() { free(s); };};void func(C c) {};void main() { C o="hello"; pri... 阅读全文
posted @ 2012-03-10 00:36 雪狼的程序故事 阅读(1418) 评论(5) 推荐(1) 编辑