std::string stringf(const char* format, ...){ va_list arg_list; va_start(arg_list, format); // SUSv2 version doesn't work for buf NULL/size 0, so try printing // into a small buffer that avoids the double-rendering and alloca path too... char short_b
1.字符串 字符串本质就是一串字符,在C++中大家想到字符串往往第一反应是std::string(后面简称string) 字符串得从C语言说起,string其实是个类,C语言是没有class的,所以C语言的字符串其实就是字符数组,也就是char [ ] ,例如: char str[10]; //定义了一个有十个元素的数组,元素类型为字符char char str[10] = {"hello"}; //"h e l l o \0"五个字符赋给str数组, 然