数字转化为标准string(opencv)

 

format 函数

Returns a text string formatted using the printf-like expression.

string format( const char* fmt, ... )


Parameters
fmt – printf -compatible formatting specifiers.

The function acts like sprintf but forms and returns an STL string. It can be used to form an error message in the

Exception() constructor.

举例: 欲创建一个文件是 ABC0004.txt。

int No = 4;

filename = "ABC" + cv::format("%.4d",No) + ".txt";

你可能感兴趣的:(function,String,Forms)