(Borland C++ free command line compiler, WinXP)
Ok, I'm switching all my functions so they use less code to read characters on a console screen. But its repeating to the max value of a short when given a negative. I tried using unsigned integers, I tried using signed integers. (Which one can go negative?) I tried using SHORTs, I dont get why its looping so much when passed a negative.
Heres my code:
Code:
char ReadPos(SHORT x, SHORT y, SHORT ix, SHORT iy) {
DWORD reader;
COORD Pos;
char EEE[1];
SHORT int v;
Pos.X = x;
Pos.Y = y;
for(v=0; v > ix; v++)
Pos.X--;
for(v=0; v > iy; v++)
Pos.Y--;
for(v=0; v < ix; v++)
x++;
for(v=0; v < iy; v++)
x++;
cout << x;
cout << y;
ReadConsoleOutputCharacter(hOt, &EEE[0], 1, Pos, &reader);
return EEE[0];
}
(HANDLE hOt is declared globaly.)
Not built in the best possible way, but it works when passed positive values.
And my call:
Code:
SomeChar[0]=ReadPos(Pos.X, Pos.Y, -1, 0);
I'm getting very confused, It cant be my for's that are conflicting because that would be illogical...
Thank you!