I am sure this is a dumb question, but is there a straightforward way to print a Unicode character in C++ given its hex code? For instance: I know that the code for ❤ is 0x2764. Is there a way I can use its code to print it (either via printf or on a stream)?
For the record, I can print the character by writing:
cout << "\u2764" << endl;
but that requires knowing the value at compile time rather than using a variable.
Thanks