/ Published in: C++
Expand |
Embed | Plain Text
std::string format_arg_list(const char *fmt, va_list args) { if (!fmt) return ""; int result = -1, length = 256; char *buffer = 0; while (result == -1) { if (buffer) delete [] buffer; buffer = new char [length + 1]; memset(buffer, 0, length + 1); result = _vsnprintf(buffer, length, fmt, args); length *= 2; } std::string s(buffer); delete [] buffer; return s; } std::string format(const char *fmt, ...) { va_list args; va_start(args, fmt); std::string s = format_arg_list(fmt, args); va_end(args); return s; }
Comments
Subscribe to comments
You need to login to post a comment.

just because we love christian louboutin,also we think it will made you be more sexy.IN christian louboutin sale,you can get your luxury christian louboutin shoes at cheap price.christian louboutin shoes(born 1964) is a footwear designer who launched his line of high-end women's shoes in France in 1991.trademark protection of this red sole design.cheap christian louboutin shoes,louboutin shoes,christian louboutin shoes on sale,christian louboutin sale,cheap ugg boots,ugg boots saleugg classic tall and ugg classic cardy,ugg classic short,cheap christian louboutin,christian louboutin pumps,cheap christian louboutin