I'm going to give a outline on DOS based graphics in C/C++ with graphics.h which can be implemented in Turbo C/CPP.DOS screen can be of 2 types. Command based or Graphics based. When we are using printf() in C or cout in CPP , we are mainly using the command console available to us. To use graphics ,we need to call a few functions.we'll now see how to use basic graphics in Turbo C/CPP.
Any device in computer requires a driver ( a program ) to have communication between device and us ( operating system/ other programs ) . In this case to initiate graphics, we need a graphics driver ( just a file ) called EGAVGA.BGI . BGI stands for Borland Graphics Interface which provided this file to be used in Turbo/Borland editions of C/C++. Let's take an example...
#include
#include "conio.h"
void main()
{
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"");
}