How to display the x and y axis in Turbo C for graphics programming. I mean is there a known code for it which I have to add in my program to display the axes?
Asked
Active
Viewed 2,212 times
-3
-
2The C standard does not know about graphics programming. Why can't you use a fancier GUI toolkit, maybe [Gtk](http://www.gtk.org/) or [Qt](http://qt-project.org/), -or [libsdl](http://libsdl.org/) and a better compiler [GCC](http://gcc.gnu.org/) – Basile Starynkevitch Nov 04 '14 at 12:59
-
I have a practical exam tomorrow and we have to do it in Turbo C only. – Aadharsh Krishnan Nov 04 '14 at 12:59
-
3Turbo C is more than 20 years old and you're not likely going to get much help with it. An exam is not practical if it relies on Turbo C. – Captain Obvlious Nov 04 '14 at 13:00
1 Answers
0
You can start by getting familiar with the graphics functions available in Turbo C and Turbo C++. For what you are trying to accomplish you will want to read up on outtextxy
which will allow you to draw text to the screen at a specific location. In C you can do something like this
char text[100];
int xPos = 6;
int yPos = 10;
sprintf(text, "X = %d, Y = %d", xPos, yPos);
outtextxy(0, 0, text);
This will display the values of xPos
and yPos
at the top left hand corner of the screen as X = 6, Y = 10
.
See the example in the link to outtextxy
for full details on which header files to include, initializing the display, and other function calls that will come in handy.

Captain Obvlious
- 19,754
- 5
- 44
- 74