I just upgraded my disosaur Visual Studio 6 to 2010 and am having problems with
[ gotoxy(x,y) ]
Did Microsoft take out the bool library and for that matter, the conio library? This simple "doodle Program" that worked perfectly in VS 6 does not work at all in VS 2010:
/*Doodle program */ #include <iostream.h> #include <conio.h> #include <random.h> int main() { randomize(); cout << "Doodler! Press I/J/K/M to move, Q to quit" << endl; char KeyPressed; // Key pressed by user int x=40; int y=10; // Establish initial position of cursor do { // Plot a "point" gotoxy(x, y); cout << '*'; gotoxy(x, y); // Move blinking cursor under current spot KeyPressed = getch(); // Get a key, not echoing to the screen if (KeyPressed == 'I' || KeyPressed == 'i') y--; else if (KeyPressed == 'M' || KeyPressed == 'm') y++; else if (KeyPressed == 'J' || KeyPressed == 'j') x--; else if (KeyPressed == 'K' || KeyPressed == 'k') x++; else if (KeyPressed == 'Q' || KeyPressed == 'q') ; // Do nothing else cout << "\a"; // Beep for bad keystroke } while ((KeyPressed != 'Q') && (KeyPressed != 'q')); gotoxy(1, 1); // Clear and display new title clreol(); cout << "Random stars! Press any key to stop." << endl; while (!kbhit()) { gotoxy(1+random(60), 2+random(20)); cout << "* "; // A star and a blank to draw AND erase } return (0); }
Any help would be greatly appreciated!
Thanks,
RG
This post has been edited by macosxnerd101: 15 February 2011 - 10:08 AM
Reason for edit:: Please use code tags