开发者

GCC : Segmentation Fault from Trim function

I got a gcc "Segmentation Fault" error with this script : http://paste2.org/p/1397204, why ?

I tested this code with Visual C++ compiler and I don开发者_开发问答't get any error...


Thanks to MByD according to Getting Segmentation Fault topic.

Replace :

printf("|%s|\n", trim("  MyStringHaveToBeTrimmed  "));

With :

char str[] = "  MyStringHaveToBeTrimmed  ";
printf("|%s|\n", trim(str));

New code : http://paste2.org/p/1397248

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜