+ 2
It seems possible, however, it seems compiler dependant.
I haven't seen color in SL playground.
You could try this somewhere in a PC compiler.
#include <stdio.h>
void red () {
printf("\033[1;31m");
}
void yellow {
printf("\033[1;33m");
}
void reset () {
printf("\033[0m");
}
int main () {
red();
printf("Hello ");
yellow();
printf("world\n");
reset;
return 0;
}
+ 2
For a console application you'd usually use escape sequences that are then interpreted by your terminal emulator. On Linux you can even set RGB colors for text and the background. You can find quite a lot of those escape sequences in this header file:
https://gitlab.com/AaronErhardt/Vino/blob/master/src/colors.hpp
On Windows you might need to replace \e with \033 though for some reason.
+ 2
Kim2000Mah That's a decent solution. Yet this is highly platform-dependend and will only work on Windows.
I recommend you to use escape sequences instead as Fernando Pozzetti and I have suggested. Escape sequences work on almost every platform and are also more powerful:
https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences#4842438



