escape sequences
-
hey everyone,
im kinda new to c++ and i got a problem with the output of escape sequences.
I use Visual Studio 2012 Desktop (C++).
Everytime i have a escape sequence in my code, it dont output/run the escape sequence.
first - here is my code:
#include <iostream> #include <iomanip> #include <cmath> #include <cstdio> #include <cctype> #include <string> //#include "myMakros.h" using namespace std; #define FARBE(v, h) (cout << "\033[1;3" << (v) << ";4" << (h) << 'm' << flush) #define SCHWARZ 0 #define ROT 1 #define GRUEN 2 #define GELB 3 #define BLAU 4 #define MAGENTA 5 #define CYAN 6 #define WEISS 7 int main() { FARBE(GELB, GRUEN) << "test" << endl; system("pause"); return 0; }
and my output is always:
←[1;33;42mtest
and not the word "test" in green letterscan someone help me please
Samy
-
Escape Sequenzen gab es mal unter DOS.... unter Windows gibt es dies nicht mehr... verwende entsprechende Bibliotheken wie pdcurses
-
Es gibt ansicon, wenn man es unbedingt mit Escape-Sequences lösen will.
-
Ansicon scheint wohl unter Windows 8 nicht mehr zu gehen...
-
Jochen Kalmbach schrieb:
Ansicon scheint wohl unter Windows 8 nicht mehr zu gehen...
Upps. Das wusste ich nicht...
-
Die aktuelle Version kann es wohl doch... es sieht aber nach sehr viel trickserein und Hooking von irgendwelchen Methoden aus... also "schön" ist was anderes (pcurses z.B.
).
-
vielen dank !!!
ich hab auf englisch geschrieben weil ich gedacht habe das ist ein englisches forum