View Full Version : How do you change to color of the text in c++.
thechillyman
01-25-2002, 02:32 PM
I am learning how to program using c++. SPAMIt 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. SPAMIf you know please reply I would be most grateful.Thanks
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
Keefe
03-05-2002, 07:00 PM
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
#include(conio.h)
textcolor(RED);cout('cow');
end
plz don't laugh, SPAMhaven't used c++ for years SPAM;)
Cheers
Chef
Keefe
03-05-2002, 08:01 PM
shouldn't it be cout << "cow"; ?
Well keefe dude, you've brought it on your ***.
I, like, totally couldn't miss this one ;)
Chef sez mooo
Chers
thechillyman1
03-06-2002, 08:25 PM
Thanks for trying to help Chef, but the code jsut doen't work. SPAMThe syntax is all wrong and when you do make it the correct cout and all it still doesn't work right
Thechillyman
>:( >:(
Keefe
03-06-2002, 09:44 PM
That is cool stuff.
Can you please attach the c++ source for that proggy?
Thanks Much
Keefe
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(68)+1,random(24)+1);
cprintf("ChefruleZ");
}
nosound();
}
Again, first time in last 2 years SPAM8)
Cheers
Chef
Look creapy for some reason, it wouldn't work with all the spaces SPAM:(
Just check the attached mooo_source.txt
Cheers
Chef
Do you really need all this, keefe ?? Or just trying to make this place more interactive ;) ?
thechillyman3
03-07-2002, 07:05 PM
Cool program.
Where can I get the graphics.h file in the source code my compiler does not have it? ;D
You can download BC++ 3.1 from software section of
www.cheflab.com
It includes everything you need to start with C/C++. All required libraries, help files, examples ...
It is NOT pirated software, but shareware version, uploaded from diskette included with some book I've purchased in 1997.
Cheers & Good luck
Chef
Aoshi
03-08-2002, 04:45 PM
ok this is going to make me sound retarded but oh well its friday and i cant think. SPAM2 things: 1st: the mooo.exe that chef made doesnt run on my comptuer, it jsut stops responding and only displys his text messge once. 2nd: when i enter in textcolor in visual studio it doesnt recognize it as a command, is there somehting i have to include?
Don't be surprised if this wouldn't work with MS VC++ ;) , because it uses different compiler, but heck with it, start with C then jump to Visual 8)
It's just stupid but pure C program; try to run it with full screen (Alt+Enter), or from DOS. It worked even on W2K, so no reason it wouldn't on any other MS OS
Cheers
Chef
Just wanted to make this topic hot SPAM8)
Textcolor is from <conio.h>
Simple is beautiful ! Have fun and run in full screen SPAM;D
Cheers
Chef
Aoshi
03-12-2002, 06:59 PM
you asked for it you got it toyota SPAM;) i like it HOT HOT HOT
vBulletin® v3.6.5, Copyright ©2000-2009, Jelsoft Enterprises Ltd.