ok, i can make colored DOS text like so...but how can I output a varible int x in that color? Is it bad to use cout and cprintf in the same program? somebody said it was but why?
textcolor(LIGHTCYAN);
cprintf(" ********************* \r\n")
ok, i can make colored DOS text like so...but how can I output a varible int x in that color? Is it bad to use cout and cprintf in the same program? somebody said it was but why?
textcolor(LIGHTCYAN);
cprintf(" ********************* \r\n")
AIM: MarderIII
IMHO, it looks abnormal to interchange c and c++ style output I have no idea what textcolor() is, here is what I'd do in MSVC
Code:#include <windows.h> .... HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); int x = 5; SetConsoleTextAttribute(hOut, FOREGROUND_INTENSITY | FOREGROUND_BLUE); cout << x;
I am against the teaching of evolution in schools. I am also against widespread
literacy and the refrigeration of food.
I had to do this once, and my solution probably isnt the best one but here:
1. Change the variable to a string by itoa(int, char *string, base) where base 10 is what we use normally.
2.change textcolor using function textcolor(?)
3.use cprintf to print the string.
you do this because i dont think u can change the color of a variable ( at least on my compiler)
~fin
how do u print a string with cprintf()?
AIM: MarderIII
itoa(num2, char *num2char, base);
the above doesnt work, not sure what this is supposed to look like
AIM: MarderIII
>>itoa(num2, char *num2char, base);
>>the above doesnt work, not sure what this is supposed to look like
You probably don't have itoa() since it's not a standard function. Use sprintf instead :-)
Code:sprintf(str, "%d", number);
*Cela*
is cprintf() the same as printf()?
if so,
cprintf("%d", number);
"There are three kinds of people in the world...
Those that can count and those that can't."