Techware Labs Header

Forums have moved

See this announcement for more details, or just go directly there.


Go Back   Techwarelabs Community > Tech > Software - Applications, Programming, and Games

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-25-2002, 02:32 PM
thechillyman
 
Posts: n/a
Default How do you change to color of the text in c++.

I am learning how to program using c++.  It is the dos programming, not the windows programming.I want to know how to make the color of the text change. Not all of it jsut the text that I want too.  If you know please reply I would be most grateful.Thanks
Reply With Quote
  #2  
Old 03-05-2002, 01:37 PM
Chef
 
Posts: n/a
Default Re: How do you change to color of the text in c++.

Thats :

textcolor(x);

with x=[0..14]

as far as I remember.

You can download C++ 3.1 with great help section, from my site

Good luck with C++, it's great stuff

Cheers
Chef
Reply With Quote
  #3  
Old 03-05-2002, 07:00 PM
Keefe Keefe is offline
Administrator
 
Join Date: May 2002
Location: Wisconsin
Posts: 2,337
Send a message via ICQ to Keefe Send a message via AIM to Keefe Send a message via MSN to Keefe Send a message via Yahoo to Keefe
Default Re: How do you change to color of the text in c++.

Can you explain that in a little more detail?

What if i wanted to output the word "cow" in red?

What would the sytax be?

Thanks
__________________
It's crazy I'm thinking, just knowing that the world is round.
-http://www.techwarepc.com/ - The Technology Experts
Reply With Quote
  #4  
Old 03-05-2002, 07:28 PM
Chef
 
Posts: n/a
Default Re: How do you change to color of the text in c++.

#include(conio.h)
textcolor(RED);cout('cow');
end

plz don't laugh,  haven't used c++ for years  

Cheers
Chef




Reply With Quote
  #5  
Old 03-05-2002, 08:01 PM
Keefe Keefe is offline
Administrator
 
Join Date: May 2002
Location: Wisconsin
Posts: 2,337
Send a message via ICQ to Keefe Send a message via AIM to Keefe Send a message via MSN to Keefe Send a message via Yahoo to Keefe
Default Re: How do you change to color of the text in c++.

shouldn't it be cout << "cow"; ?
__________________
It's crazy I'm thinking, just knowing that the world is round.
-http://www.techwarepc.com/ - The Technology Experts
Reply With Quote
  #6  
Old 03-06-2002, 04:41 PM
Chef
 
Posts: n/a
Default Re: How do you change to color of the text in c++.

CMON !!  
Reply With Quote
  #7  
Old 03-06-2002, 05:51 PM
Chef
 
Posts: n/a
Default Re: How do you change to color of the text in c++.

Well keefe dude, you've brought it on your ***.
I, like, totally couldn't miss this one

Chef sez mooo
Chers
Reply With Quote
  #8  
Old 03-06-2002, 08:25 PM
thechillyman1
 
Posts: n/a
Default Re: How do you change to color of the text in c++.

Thanks for trying to help Chef, but the code jsut doen't work.  The syntax is all wrong and when you do make it the correct cout and all it still doesn't work right

Thechillyman

> >
Reply With Quote
  #9  
Old 03-06-2002, 09:44 PM
Keefe Keefe is offline
Administrator
 
Join Date: May 2002
Location: Wisconsin
Posts: 2,337
Send a message via ICQ to Keefe Send a message via AIM to Keefe Send a message via MSN to Keefe Send a message via Yahoo to Keefe
Default Re: How do you change to color of the text in c++.

That is cool stuff.

Can you please attach the c++ source for that proggy?

Thanks Much

Keefe
__________________
It's crazy I'm thinking, just knowing that the world is round.
-http://www.techwarepc.com/ - The Technology Experts
Reply With Quote
  #10  
Old 03-07-2002, 04:35 AM
Chef
 
Posts: n/a
Default Re: How do you change to color of the text in c++.

Nothing I can be proud of, but if you insist :

#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
#include<graphics.h>
main(){
clrscr();
printf("Experience the power of Chef now ...");
delay(10000);
clrscr();
randomize();
gotoxy(1,25);printf("Visit www.cheflab.com for BETTER things ");
for(int i=0;i<1000;i++)
{
sound(random(2000));
delay(20);

textcolor(random(14)+1);

gotoxy(random(6+1,random(24)+1);
cprintf("ChefruleZ");
}
nosound();
}

Again, first time in last 2 years  

Cheers
Chef
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:29 PM. Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum style by ForumMonkeys.