pos text
-
danke !
genau was ich gesucht habe
super
-
sorry nochmal was ?
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord+1);
wie mach ich denn : coord + 1
-
Wo willst du denn 1 dazuaddieren? x? y?
Musst dich schon entscheiden.
-
also bei y
-
#include <iostream> #include <windows.h> using namespace std; int main() { int y=15; COORD coord = {15, y}; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord); cout << "Hallo!"; ++y; COORD coord = {15, y}; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord); cout << "Hallo!"; cin.get(); return 0; }
-
@ volkard:
Vielleicht das zweite Mal einen anderen Bezeichner fürcoordwählen.
-
Nexus schrieb:
@ volkard:
Vielleicht das zweite Mal einen anderen Bezeichner fürcoordwählen.
jup.
ich wollte die beiden drei zeilen in eine eigene funktion stecken, habe alles vorbereitet und es dann vergessen.
-
Muss man doch nich neu definieren.
#include <iostream> #include <windows.h> using namespace std; int main() { COORD coord = {15, 15}; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); cout << "Hallo!"; coord.Y++; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); cout << "Hallo!"; cin.get(); return 0; }:p
-
ich habs so geamcht:
#include <iostream> #include <windows.h> using namespace std; int main() { int X = 4; int Y = 7; COORD coord1 = {X, Y}; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord1); cout<<"1"; Y+1; Sleep(1000); cout<<"2"; cin.get(); return 0; }
-
Y+1;Diese Anweisung wird sicher ungeahnte Auswirkungen nach sich ziehen... :p
-
das klappt aber mit Y=Y+3; nicht. musst schon jedesmal die cursorsetzfunktion aufrufen.
-
Guck am besten nochmal auf die erste Seite.
Dein jetziger Code ist kaese.