i change the colors in a console game i am amking, but how do i return the colors to the normal dos mode color. i know its not white cause its to bright! i use this code with the conio.o header file
Code:textcolor(WHITE); clrscr();
i change the colors in a console game i am amking, but how do i return the colors to the normal dos mode color. i know its not white cause its to bright! i use this code with the conio.o header file
Code:textcolor(WHITE); clrscr();
Um...i'm assuming you have a typo and you mean conio.h. And it is white.
No, default color for DOS is LIGHTGRAY.
Or I got some wierd version of DOSCode:textcolor(LIGHTGRAY); clrscr();
"Um...well..."
-Kyoto Oshiro
When I tried this code it didn't work. Here's my code.
Code:#include <iostream> #include <conio.h> using namespace std; int main() { textcolor (RED); clrscr(); cout << "Testing"; return 0; }
Compiler: Dev-C++ 4.9.8.0
-Bert
Bert, I am not sure whether you put a space between textcolor and the first bracket, may just be a typo, but you need to type it like above, then it will work fine.Code:#include <iostream.h> #include <conio.h> int main() { textcolor(RED); clrscr(); cout<< "Testing\n"; cout<<endl; return(0); }
"Um...well..."
-Kyoto Oshiro
>Bert, I am not sure whether you put a space between textcolor
>and the first bracket, may just be a typo, but you need to type it like above, then it will work fine.
Huh? Whether you put a space between the function identifier and the argument list is irrelevant, it will work both ways assuming conio.h supports textcolor. Unless, of course, they've changed the free-form nature of C++ while I wasn't looking.
>#include <iostream.h>
For the record, the .h extension to C++ header files has been deprecated. You really shouldn't be using it if you want your code to work indefinitely.
Bert, the functions contained in conio.h are very much implementation-specific. Make sure that your compiler supports the functionality that you want. To my knowledge, only Borland supports textcolor, though Dev C++ may as well.
-Prelude
My best code is written with the delete key.
Oh...well...remind me not to answer any more questions Sorry Bert, maybe it is your compiler then. I just thought that maybe the space mattered...right...read my signature when in doubt.
"Um...well..."
-Kyoto Oshiro
>I just thought that maybe the space mattered
If it did then I would be in big trouble. My style looks like this:
textcolor ( RED );
-Prelude
My best code is written with the delete key.
-I use Bloodshed Dev-C++ 4.9.3.0 so it may be my complier.
-That space wasn't a typo, I put it there on purpose. And you can have as many spaces you want in your C++ source code.
Will still print "Testing".Code:#include <iostream> int main() { c o u t < < "Testing "; re turn 0; }
Compiler: Dev-C++ 4.9.8.0
-Bert
hey, bert...just a well known fact here...HTML is not a programming language...it's a scripting language..
.
if ur using dev c++ like yours truly make sure u open ur project using the .dev fiel not .cpp file so ur editing the project file nto just the .cpp file. and go to project on the top menu bar thing go to project options and you gotta add conio.o from the c:\dev-c++\libraries\conio.o or its osmethgin like that but the directires cant have spaces (that the file is in) so its best to install dev c++ at its defualt directory.