i have a homework for our programmin classes, i searched for other solutions regarding the gotoxy function, but all saw was for devc++, turboc++ and other IDEs, when i use the function for devc++ or turboc++, i know it wont work, but i tried it, says there's not library for gotoxy..


can somebody please help me?
:'(

gotoxy() is a function only supported by Turbo C and Turbo C++. No other compiler in the whole wide world supported it. So if you want to use a different compiler then you will have to find a different way to accomplish the same thing, such as write your own gotoxy() function.

You can find some alternate solutions here.

so.. how am i goin to write my own? im still new to c++, and im not that familiar to the other programs, so,. i still have lots more to learn,. can you give me an example? well.. if you want,.that is.. ^^;

See the move() method in this library. I've never used it but it claims to work with console based windows apps. You may need to dig around a bit to figure out how to use the dll with your programs. I think something like this is the closest you are going to get. Either that or upgrade your Borland professor to a Microsoft one.

ahm. im using microsoft visual studio., not borland... ?O_o well,. thanks for the link,. ^^

Quoth the Dragon: gotoxy() is a function only supported by Turbo C and Turbo C++

I meant that your professor wants you to use these Borland functions :) so upgrade her/him to work with your Microsoft compiler

commented: They should upgrade their professor to someone whio actually has a clue about something less than 20 years out of date +17

so.. how am i goin to write my own? im still new to c++, and im not that familiar to the other programs, so,. i still have lots more to learn,. can you give me an example? well.. if you want,.that is.. ^^;

Read the links I posted -- they will tell you how to do it.

If you're using windows then it's easy :)

void gotoxy(int x, int y) {
  static HANDLE hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
  COORD c = {x, y};
  SetConsoleCursorPosition( hConsole, c );
}

that's the function that i have to use in C++? well,.thanks for your help.. :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.