Are there C++ equivalents of sscanf and sprintf functions that takes a pointer to the C++ string class as the argument?
Also what's the C++ equivalent of printf to do formatted output? Thanks!
Printable View
Are there C++ equivalents of sscanf and sprintf functions that takes a pointer to the C++ string class as the argument?
Also what's the C++ equivalent of printf to do formatted output? Thanks!
Not that I know of, so you might either use a stringstream, or create a std::string s with the desired size and then pass &s[0] as an argument to sscanf (but then be warned about the danger of buffer overflow, plus you need to account for the null terminator).Quote:
Originally Posted by acppdummy
You can use Boost.Format for something similiar.Quote:
Originally Posted by acppdummy