Code:
for(int i=6; i<50; i+=6){
cout << "10\n"<<"a"<<endl;
curPos(i,0);
}
for(int i=6; i<50; i+=6){
cout << "10\n"<<"a"<<endl;
curPos(i,0);
}
pri cemu sam ovu f-ju curPos iskopao ne netu i ona glasi
Code:
void curPos(int x, int y) {
HANDLE hStdout;
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
hStdout=GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hStdout, &csbiInfo);
csbiInfo.dwCursorPosition.X=x;
csbiInfo.dwCursorPosition.Y=y;
SetConsoleCursorPosition(hStdout, csbiInfo.dwCursorPosition);
}
void curPos(int x, int y) {
HANDLE hStdout;
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
hStdout=GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hStdout, &csbiInfo);
csbiInfo.dwCursorPosition.X=x;
csbiInfo.dwCursorPosition.Y=y;
SetConsoleCursorPosition(hStdout, csbiInfo.dwCursorPosition);
}
E sad izlaz ovakvog programa je nesto ovako:
Code:
10 10 10 10 10 10 10 10
a
10 10 10 10 10 10 10 10
a
a meni bi trebelo
Code:
10 10 10 10 10 10 10 10
a a a a a a a a
10 10 10 10 10 10 10 10
a a a a a a a a
Problem je u tome sto svaki put kad se ispise kraj reda on sledeci red pocinje od pocetka i pri tome prepise staro a, a ja bih zeleo da i sledeci red pocinje od istog pomeraja na x-osi.
Ako neko ima resenje problema, ja se maximalno zahvaljujem.