Depending on what you want to use more printf formatting options, you can use sprintf
With it, you can format the string in the same way as with printf, and then print it with std::cout
However, this will be due to the use of a temporary char array, so the choice depends.
Example:
unsigned char *teta = ....; ... char formatted[ 256 ];
lamas Apr 14 '11 at 0:15 2011-04-14 00:15
source share