#include 的解決


在學習《C語言程序設計案例教程》的時候需要使用EasyX,需要使用Visual Studio開發環境。在C程序中使用#include <graphics.h>的時候出現了如下錯誤:

#include "pch.h"
#include <graphics.h>	
#include <math.h>
#include <conio.h>				

int main()
{
	int x, y, r, t;

	x = y = 100;
	r = 80;
	t = (int)(sqrt(2.0)*r / 2);
	initgraph(640, 480);
	circle(x, y, r);
	rectangle(x - t, y - t, x + t, y + t);
	_getch();
	closegraph();
	return 0;
}


解決的方法是去EasyX官網下載EasyX的exe程序,點擊后直接對自己使用的VC版本進行安裝就行了,很簡單。

運行結果如圖:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM