Showing posts with label int to string. Show all posts
Showing posts with label int to string. Show all posts

3/16/2018

simple tip: int to string in stl

memo for me.. ^^

for(int i=0; i<10; ++i)
     std::string index1("string_" + std::to_string(i) + ".jpg");



11/09/2015

integer to string ( _itoa_s )

see code


...
int increase = 0;
char str[100];
_itoa_s(time(0),str,10); //10 means decimal so 8:octal, 16Lhex, 2:binary
sprintf_s(str, "%s_%d", str, increase);
printf("%s \n", str );


...