Graphic functions for "C"

haboles used Ask the Experts™
hey ,

hey ,
where can i find the basic graphic function for "c".
in particular i look for the very basic options to clear the screen and print lines with color.

thanks in advance!
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
clrscr() clears the screen,  hmm maybe not in gcc though.

The file u are looking for is graphics.h i think.  Here is a link.
C has no standard "graphics" functions.  It is a low-level programming language and as such has none of that clutter built-in to the standard.

That graphics.h is a Borland-specific header file for the Borland Graphics Interface (BGI).  BGI is extremely old and outdated (I remember using it in the early 90's), and, again, unless you have a Borland compiler (for DOS, none the less), it's useless.

In order to do any sort of graphics programming, you need an external library to link with your program.  What kind of library and how to use it depends on your operating system and compiler.

There are several libraries available.  Many of them are cross-platform so it doesn't matter what OS you are trying to use them with.  One example is SDL (  It actually supports more than just graphics, but lots of other things as well (keyboard, mouse, joystick, audio, cd audio, timing, threading).  You get the necessary headers to #include in your source code, along with the libraries that you give your compiler system, and you use their stuff to do what you like.

For Windows, you also have the option of using DirectX, though, for reasons I won't go into here, it really sucks trying to write DirectX code without a C++ compiler.

OpenGL is another option, and is also supported on multiple platforms.

All in all, the point is that there are no C "graphics functions," but there are libraries of graphics functions that you can use with your C programs.  Check out some of the examples I gave you, hopefully you'll find some direction.
Top Expert 2006

No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:
PAQed with A grade to bsdpimp

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.


EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial