How easy to use &as suggested?
#include <iomanip>
#include <iostream>
#include <sstream>
int main() {
std::stringstream os;
os << &std::hex;
os << std::setw(2);
os << std::setfill('0');
os << 13;
std::cout << os.str() << "\n";
return 0;
}
Yes, it works too .
What is the difference?
std::hex is a function reference&std::hex is a function pointer
, ostream, , . -, MISRA , , , , .