杀毒软件红伞赛尔
来源:百度知道 编辑:UC知道 时间:2024/06/09 17:30:26
........... 的号 追分
#include <cassert>
#include <cstdarg>
#include <sstream>
#include <string>
using namespace std;
string& stringprintf( string &s, const char *fmt, ... )
{
assert( s.empty() );
va_list ap;
va_start(ap, fmt);
const char *next_c; // next character
while ( *fmt != '\0' )
{
switch ( *fmt )
{
case '%':
{
next_c = fmt + 1;
switch ( *next_c )
{
case '\0':
s += *fmt;
break;
case '%':
s += '%';
++fmt;
break;
case 's':
s += va_arg(ap, char*);