I need the ability to change text color dynamically within a page without using the clear screen command clrscr();. I do know that this works:
Code:
cout << "The last word in this sentence is ";
textcolor(RED);
cprintf("red");
textcolor(LIGHTGRAY);
but I need to be able to output dynamic variables this way too, like this, but it does not work:
Code:
int var;
cout << "Give var a value: ";
cin >> var;
cout << "In var, you inputted the number ";
textcolor(RED);
cprintf(var);
textcolor(LIGHTGRAY);
So why? and how can I get it work? Did I miss something? thanks