Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to write underlined text in c++?

Posted on 2006-11-13
10
Medium Priority
?
1,008 Views
Last Modified: 2012-06-21
Hello i want to write a underlined heading at the begining of the program . How can i do that ?
0
Comment
Question by:emreayman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 17934995
On what kind of output device?
Is it a VT100 compatble display?   A HTML browswer?
0
 

Author Comment

by:emreayman
ID: 17935004
it is win32 app.  (DOS)
0
 

Author Comment

by:emreayman
ID: 17935030
cout << "WELCOME";

how can i write this underlined.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 84

Expert Comment

by:ozo
ID: 17935093
If you load
device=c:\windows\command\ansi.sys
in your CONFIG.SYS file, then you should be able to
cout << "\033[4mWELCOME\033[0m";
0
 

Author Comment

by:emreayman
ID: 17935122
Is there another way ?.it's a console application .
0
 
LVL 84

Expert Comment

by:ozo
ID: 17935320
0
 
LVL 5

Expert Comment

by:NickGeorghiou
ID: 17938903

cout << "WELCOME" << endl;
cout << "------------" << endl;

:-)

sorry, just trying to be funny...
0
 

Author Comment

by:emreayman
ID: 17939477
thank you ozo and NickGeorghio :)  . ozo i added this line device=c:\windows\command\ansi.sys  in command.com and tried with your code but it didn't work . Let's say it works If i run it under another computer that ansi.sys not loaded it's not going to show text underlined right? . Is there a another simple method (I'm writing my program in Visual C++)
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 500 total points
ID: 17939830
>>>> Is there a another simple method (I'm writing my program in Visual C++)

The problem is not in C++ but in the console. A console output cannot be underlined beside you would find a console font where each character already includes a '_' (visually).

What you can do in a Win32 console is to write text in different colors. Maybe you can substitute the underlining by using an appropriate coloring. To see the possibilities you should load the CONSOLE sample from MSDN_LIB. You'll find a link to that sample in MSDN by the title 'Console sample (console functions)' .

Regards, Alex
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question