What is the equivalent of ToString("00") in C++? -
What is the equivalent of ToString("00") in C++? -
what equivalent of .tostring("00")
in c++?
i'm getting error stating that
left of '.tostring' must have class/struct/union 1> type 'double'
update: replies, i'm having similar issue //inorder //.tostring("00.00000") did following
memset(buf, 0, sizeof(buf)); sprintf_s(buf, "%02.7f",latm); //.7 match heremisphere std::string latm_str = buf;
i realised %02 doesnt have effects, illustration when 7.0, result 7.0000000 rather desired 07.0000000, wrong here?
double number = 3.14; char buf[100]; sprintf_s(buf, "%02d", (int)number); string s = buf; cout << s; // prints 03
based on custom string formatting: tostring("00")
c++
Comments
Post a Comment