How can I underline a text which is supposed to be an output of a c++ code?
Somewhere in the web I saw this:
cout<<underline<<"This is the text which is going to be underlined.";
But, for me this "underline" is not working. Any idea is very welcome.
Are you outputting to an ANSI terminal? If so, the following escape sequence should work:
#define underline "\033[4m"
More information on ANSI escape sequences is available here.
Note: To turn underlining off again, use "\033[0m"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With