943,641 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 431
  • C++ RSS
May 14th, 2009
0

changing fonts?

Expand Post »
it is possible to change the colour of the font in the terminal by using come sort of code, not sure of the correct term, what im after is like cout << "hello" << endl; and hello would be bold or a different colour, can that be done?
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
Usura is offline Offline
30 posts
since Apr 2009
May 14th, 2009
0

Re: changing fonts?

Reputation Points: 453
Solved Threads: 57
Posting Virtuoso
twomers is offline Offline
1,873 posts
since May 2007
May 14th, 2009
0

Re: changing fonts?

thank you so much very quick reply also
Reputation Points: 10
Solved Threads: 1
Light Poster
Usura is offline Offline
30 posts
since Apr 2009
May 14th, 2009
0

Re: changing fonts?

#include <iostream>

using namespace std;

int main()
{
for (int i = 31; i <= 37; i++)
{
cout << "\033[0;" << i << "mHello!\033[0m" << endl;
cout << "\033[1;" << i << "mHello!\033[0m" << endl;
}
return 0;
}


woot!
Reputation Points: 10
Solved Threads: 1
Light Poster
Usura is offline Offline
30 posts
since Apr 2009
May 14th, 2009
0

Re: changing fonts?

Reputation Points: 39
Solved Threads: 24
Junior Poster
dubeyprateek is offline Offline
176 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: String arrays
Next Thread in C++ Forum Timeline: getting decission from message box?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC