Avatar of sashraja
sashraja
 asked on

cursor positioning on screen using c/c++

Hi,
I tried C/C++ program to place the cursor on screen position but gotoXY is not working on microsoft Visual studio.
Please anyone give me an idea how can i write a program for this using microsoft visual studio.
graphics.h wont work..i think..

C

Avatar of undefined
Last Comment
jmcg

8/22/2022 - Mon
Exceter

>> but gotoXY is not working on microsoft Visual studio.

I beleive that the gotoxy() function is Borland specific.

Exceter
mrwad99

I am trying to do exactly the same thing and am still trying out suggestions.  The information I have been given by experts so far is at

https://www.experts-exchange.com/questions/20520321/Splitting-a-DOS-console-window.html

And yes, gotoXY will not work in MSVC++, but will in some other compilers.

:(
sashraja

ASKER
Thx mrwad99,

I have the same problem as yours. I tried all the solution given for your questions but nothing worked for me. i am waiting for some to gimme a solution.

Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Kocil

This simple thing looks so complicated in MSVC++ :)
How about using BIOS interrupt

/*
INT 10 - VIDEO - SET CURSOR POSITION
     AH = 02h
     BH = page number
     DH = row (00h is top)
     DL = column (00h is left)
Return: nothing
*/

#define geninterrupt(i) __int__(i)

void mygotoxy(unsigned char x, unsigned char y)
{
   _AH = 0x2;
   _BH = 0;
   _DH = x;
   _DL = y;
   geninterrupt(0x10);
}

Hey ... how about to use Borland compiler for your DOS project. It's conio.h kick ass.
Download it for free from http://bdn.borland.com/museum/

Turbo C 2.01 => C only, then a top choice
Turbo C++ 1.01 => support C++ but not so complete
 
Exceter

>> how about to use Borland compiler for your DOS project

That would be the best course of action in my opinion. However, I would download Borland C/C++ 5.5. It is free to download from borland provided you register(Free) with them.

http://www.borland.com/products/downloads/download_cbuilder.html

Exceter
Kocil

The free Borland C++ 5.5 is only command line compiler without IDE.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
mrwad99

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Exceter

>> The free Borland C++ 5.5 is only command line compiler without IDE.

So? If you really want an IDE download textpad, or an equivalent program, and inside 10 seconds of configuration it will compile your programs using any compiler you want.

Exceter
mrwad99

sashraja.........

Did that work ok ?!?!?!?!
jmcg

Nothing has happened on this question in over 8 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by mrwad99 (acknowldging good responses from others, but too few points...).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck