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"
.