should be include the specific name of libary (eg: stdlib.h) to coding the text color ???
should be include the specific name of libary (eg: stdlib.h) to coding the text color ???
What? Please rephrase your jumble of words in the form of an actual question.Originally posted by beely
should be include the specific name of libary (eg: stdlib.h) to coding the text color ???
Quzah.
Hope is the first step on the road to disappointment.
adding "include <stdio.h>" only on the text color coding???
Neither can I. I suspect they're asking what header to include for things like "textcolor( )". (Borland compilers.)Originally posted by vVv
Yes. (I don't get it)
Check your compiler reference, or you could always try searching.
Quzah.
Hope is the first step on the road to disappointment.
yes, my friends, the meaning is like that. sorry for poor grammars then ...
oh then, could ms vc++ compile it ??Originally posted by quzah
Neither can I. I suspect they're asking what header to include for things like "textcolor( )". (Borland compilers.)
Check your compiler reference, or you could always try searching.
Quzah.
oh, i have tried already, can't find the example of text color coding. from the previous thread, shown that the source code of changing the textcolor. but it can't working.Originally posted by vVv
I think it's #include <conio.h> on Borland and MS compilers, #include <conio.c> if you happen to be using MingW/DevC++. Next time do as quzah suggested and consult google.
MSVC++ doesn't have a way to change console text color, if I recall correctly. You might want to check the MSDN for more information, or your compilers help files.
Quzah.
Hope is the first step on the road to disappointment.
thanks for help.
here is some simple code for textcolor in console mode:
Code:#include <iostream.h> #include <windows.h> #include <conio.h> #define co1 1 #define co2 2 #define co3 3 #define co4 4 #define co5 5 #define co6 6 #define co7 7 #define co8 8 #define co9 9 #define co10 10 #define co11 11 #define co12 12 #define co13 13 #define co14 14 #define co15 15 #define co16 16 #define co17 17 #define co18 18 #define co19 19 #define co20 20 void textcolor(WORD color) { SetConsoleTextAttribute(::GetStdHandle(STD_OUTPUT_HANDLE), color); } int main() { textcolor(co1); cout << "co1" << endl; textcolor(co2); cout << "co2" << endl; textcolor(co3); cout << "co3" << endl; textcolor(co4); cout << "co4" << endl; textcolor(co5); cout << "co5" << endl; textcolor(co6); cout << "co6" << endl; textcolor(co7); cout << "co7" << endl; textcolor(co8); cout << "co8" << endl; textcolor(co9); cout << "co9" << endl; textcolor(co10); cout << "co10" << endl; textcolor(co11); cout << "co11" << endl; textcolor(co12); cout << "co12" << endl; textcolor(co13); cout << "co13" << endl; textcolor(co14); cout << "co14" << endl; textcolor(co15); cout << "co15" << endl; textcolor(co16); cout << "co16" << endl; textcolor(co17); cout << "co17" << endl; textcolor(co18); cout << "co18" << endl; textcolor(co19); cout << "co19" << endl; textcolor(co20); cout << "co20" << endl; textcolor(co15); cout << "Press any key to continue... "; cout << flush; getch(); return 0; }
yes, the code above is written in c++
but you can use the WinAPI in C also...
just put some printf(); for the cout << should work also
dune i just wanted to say that that piece of code is not a timesaver why dont u use a loop to cycle trhough the colors ??
Code:for(color=0;color<whatever;color++)
i just wanted to show a simple way
i c
Originally Posted by Salem