// int sprintf( char *buffer, const char *format, [ argument] … );
//参数列表
// buffer:char型指针,指向将要写入的字符串的缓冲区。
// format:格式化字符串。
// [argument]...:可选参数,可以是任何类型的数据。
// 返回值:字符串长度(strlen)
int aa = 30;
char c[8];
int length = sprintf(c, "%05X", aa);
cout<<c<<endl; // 0001E
将char[]->string
char c[20];
sprintf(c, "%s", i++);
string s = c;
imwrite(s, img);