about graphics.h

Jun 7, 2012 at 6:27am
no ideas about it ....could any1 help it out....initialisations ,graphic drivers,etc
Jun 7, 2012 at 9:55am
graphics.h is not part of the standard, so we have no idea which graphics.h you are talking about. There have been many, many files named graphics.h over the years.
Jun 7, 2012 at 1:54pm
Pardon me...I am abeginner...
"graphics.h is not part of the standard"... & i cant understand it..
Further,this is a programme given in a website to draw a circle..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<graphics.h>
#include<conio.h>
 
main()
{
   int gd = DETECT, gm;
 
   initgraph(&gd, &gm, "E:\TC\BGI");
 
   circle(100, 100, 50);
 
   getch();
   closegraph();
   return 0;
}

i am just blank about it..when i put it out in turbo c++
1.compilation gave no error
2.running gave 3 errors

this is the graphics.h i was speaking of....
& thanks for rsponding to my question....pls help on this
Last edited on Jun 7, 2012 at 1:56pm
Jun 7, 2012 at 2:12pm
"graphics.h is not part of the standard"... & i cant understand it..


The C++ programming language defines a number of header files. Everyone has those header files. graphics.h is something that YOU have, because YOU have turbo C++ and it comes with turbo C++. Almost nobody else has it, because nobody else uses turbo C++.

The best advice I can give you is to not use turbo c++. It's really, really old. Your code above is NOT correct C++. You should throw away turbo C++ and get a real, modern C++ compiler. They are free.
Jun 13, 2012 at 12:10pm
Whaat compiler would u recommend??
Jun 13, 2012 at 12:17pm
Did you mean a compiler, or did you mean an IDE with compiler included?

The compiler is the command-line tool that turns your text files into bionary executables and libraries. An IDE is a set of nice utilities and tools and windows that help you organise your work, and then calls the compiler for you.
Jun 13, 2012 at 2:56pm
Moschops is being really curmudgeonly.

"graphics.h" is an old DOS programming library to play with your video card. You can find a version designed for modern Windows systems here:
http://winbgim.codecutter.org/

It is designed for use with the MinGW port (of GCC), but it can be made to work with other compilers easily enough -- if you know what to do. (If you are a beginner just stick to using the MinGW toolchain.)

There are other options for graphics programming. If you are looking to get into games and the like, check out
http://www.libsdl.org/
or
http://www.sfml-dev.org/

Good luck!
Jun 13, 2012 at 3:41pm
Hi macs, recently I used Turbo C++. It's awesome for learning C++, really awesome.
I suggest that continue learning C++ with that compiler and learn C++ concepts like inhretance etc and not learning header files. But after some time, migrate to a better compiler like GCC or something else.
Most newbies try to play with graphical abilities of C++ and maybe graphics.h! As expert guys said, this is not a standard C++ header. If you want to learn graphics programming use one of the options that Duoas said or you can learn OpenGL, it is very low level but sdl or sfml are much better.

Good Luck ;)
Jun 13, 2012 at 3:46pm
Hi macs, recently I used Turbo C++. It's awesome for learning C++, really awesome.


It is awesome for learning C++ in 1991. It's not so good if you want to learn the C++ used in the year 2012 (or indeed, any year since 1998 onwards).
Jun 13, 2012 at 5:11pm
Indeed, TC++ is pre-standard C++. Don't waste your time with such an ancient compiler.

There are a lot of good modern compilers you can get for free.
Jun 13, 2012 at 8:30pm
I think you have not described the path of graphics.h header file correctly.
Check it explicitly into your c drive or where ever u have installed it.
Then write the path.
I think it would be c:\\turboc3\\bgi if you are using turboc3 or may be anything else.
try it.
Topic archived. No new replies allowed.