Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ convert int to string with a fixed number of digits

#include <sstream>
#include <iomanip>

std::stringstream ss;
ss << std::setw(10) << std::setfill('0') << i;
std::string s = ss.str();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #int #string #fixed #number #digits
ADD COMMENT
Topic
Name
6+3 =