dos_compilers/Borland Turbo C++ v1/EXAMPLES/DYNPOINT.CPP
2024-07-02 07:34:51 -07:00

25 lines
554 B
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// DPOINT.CPP -- exercise in Chapter 5, User's Guide
#include <iostream.h>
#include <graphics.h>
#include <conio.h>
#include "figures.h"
int main()
{
// Assign pointer to dynamically allocated object; call constructor
Point *APoint = new Point(50, 100);
// initialize the graphics system
int graphdriver = DETECT, graphmode;
initgraph(&graphdriver, &graphmode, "..\\bgi");
// Demonstrate the new object
APoint->Show();
cout << "Note pixel at (50,100). Now, hit any key...";
getch();
delete APoint;
closegraph();
return(0);
}