Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ underline output

Tags:

c++

underline

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.

like image 244
user2326844 Avatar asked Dec 01 '22 19:12

user2326844


1 Answers

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

like image 145
r3mainer Avatar answered Dec 05 '22 16:12

r3mainer