Reputation: 35
For example this piece of code :
#include <iostream>
using namespace std;
int main()
{
cout << "\033[31m" << ".";
return 0;
}
prints a red dot in a visual studio console, but in a codeblocks console it prints this :
[31m*
If anyone knows how to fix this problem for the codeblocks console.
Thanks
Upvotes: 1
Views: 734
Reputation: 25633
Every console can use control code sequences as it likes. There are numbers of different standards. If you like to control your output with a given set of control sequences, you have to satisfy that the used console is able to handle them. Some terminal emulators can be configured to use a special emulation, some others have no control sequences at all.
Take a look on Terminal Emulations to get an idea how many different terminal emulations are available. And the Wikipedia article lists only a subset!
and so on how do i change the output color in a console like codeblocks
First: Take a look on the user manual and search for "terminal emulation". Maybe you find the used control set, maybe you will find out that your console in your used IDE has non! If so, it is like it is.
Maybe you can use a different terminal emulator for your editor: How to change used terminal in Code::Blocks
Upvotes: 1