INT Turn String Standard Writing

xiaoxiao2021-03-06  40

It used to use the GCVT () function (more unconventional) and sprintf (), from today, write C no longer use.

The current writing is:

#include

#include

Using namespace std;

String foo (int)

{

INT i = xx;

String Str;

Stringstream out;

OUT << i;

OUT >> Str; // Str is the value of i XX

Return Str;

}

If you use Boost, there is a simpler write, but it is true.

转载请注明原文地址:https://www.9cbs.com/read-61295.html

New Post(0)