A simple Ege program:
#include"Graphics.h" //header file for Ege libraryintMainintargcChar**argv) {Initgraph ( the, -);//initializing the drawing windowOuttextxy ( -, -,"Aloha world!"); Line (Ten,Ten, -, $); Circle ( -, +, -); Ege::getch (); //Add Ege:: namespace because there are getch functions in the Conio.h file. Avoid conflicts being overwritten. Closegraph ();//drawing ends close the drawing window. return 0;//The CPP program returns an integer without a final return. But for readability, I want to add. }
Let's look at the contents of the "Graphics.h" header file. (catalog: C:\Program files\dev-cpp\mingw64\x86_64-w64-mingw32\include--Graphics.h)
#ifndef _graphics_h_ #define _graphics_h_
/ * declares that a C + + compiler is required to use the Ege graphics library */#ifndef __cplusplus#error you must using C + + compiler, or you need FileName with '. cpp ' suffix#endif'ege.h'using namespace Ege; #endif
C + + Learning Note--season 2