C++學習筆記--Season 2

來源:互聯網
上載者:User

標籤:

一個簡單的EGE程式:

#include "graphics.h"     //EGE庫的標頭檔 int main(int argc, char** argv) {    initgraph(320,240);     //初始化繪圖視窗     outtextxy(20,120,"Aloha World!");    line(10,10,300,200);    circle(30,40,20);        ege::getch();   //此處加ege::名字空間,是因為conio.h檔案裡面也有getch函數。避免衝突被覆蓋。     closegraph();   //繪圖結束關閉繪圖視窗。         return 0;       //CPP程式不加最後的return也會返回一個整形。但是為了可讀性,自己要加上。 }

下面看看“graphics.h”標頭檔裡面的內容。(目錄:C:\Program Files\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include --> graphics.h)

#ifndef _GRAPHICS_H_#define _GRAPHICS_H_
/*聲明必須用C++的編譯器器才可以使用EGE圖形庫*/#ifndef __cplusplus#error You must use C++ compiler, or you need filename with ‘.cpp‘ suffix#endif#include "ege.h"using namespace ege; #endif

 

C++學習筆記--Season 2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.