-1
How can I put a color in ONLY one variable of my code in C?
I could only change all the colors of ALL of the letters with system("color 02");
with the library #include <conio.h>
.
But how do I have multiple colors on the same screen?
For example, how would you put each color name there with its own color on the same screen?
Edit: even if I put several system color 02 or textcolor it changes only once the color of the letter and does not allow multiple colors...
printf("\t\t================ MENU ==================\n");
printf("\n\t\t\tDigite 1 para a cor verde\n");
printf("\t\t\tDigite 2 para a cor azul\n");
printf("\t\t\tDigite 3 para a cor amarelo\n");
printf("\t\t\tDigite 4 para a cor vermelho\n");
printf("\t\t\tDigite 5 para a cor roxo\n");
printf("\t\t\tDigite 6 para a cor marrom\n\n");
printf("\t\t================ MENU ==================\n");
It didn’t work, compiled but the letters get strange characters in their place
– weise
This works if your Windows is younger than 10 Threshold 2 (or if it’s Unix, of course), otherwise you have to use the Windows console API
– Wtrmute