摘要: 要注意使用断言判断传入的字符串非空。 1 #include <cassert> 2 3 //求字符串长度 4 size_t StrLen(const char *str) 5 { 6 assert(str != nullptr); 7 size_t len = 0; 8 while (*str++ 阅读全文
posted @ 2016-03-11 21:37 jz_cnblogs 阅读(366) 评论(0) 推荐(0) 编辑