源代碼
#include <graphics.h> // 就是需要參考這個圖形庫
#include <conio.h>
void main()
{
initgraph(640, 480); // 這里和 TC 略有區別
circle(200, 200, 100); // 畫圓,圓心(200, 200),半徑 100
getch(); // 按任意鍵繼續
closegraph(); // 關閉圖形界面
}
錯誤如下
c:\program files (x86)\microsoft visual studio\vc98\include\winnt.h(1091) : error C2146: syntax error : missing ';' before identifier 'KSPIN_LOCK'
c:\program files (x86)\microsoft visual studio\vc98\include\winnt.h(1091) : fatal error C1004: unexpected end of file found
看了winnt.h頭檔案,并不是缺少“;”的問題,在網上也沒有找到具體的答案
uj5u.com熱心網友回復:
16.2 Using Spin LocksSpin locks are Kernel-defined, kernel-mode-only synchronization mechanisms, exported as an opaque type: KSPIN_LOCK. A spin lock can be used to protect shared data or resources from simultaneous access by routines that can execute concurrently and at raised IRQL in Windows NT SMP machines.
你是 Writing Windows NT Kernel-Mode Drivers ?
uj5u.com熱心網友回復:
initgraph,這個函式我不理解,是設定顯示方式吧?你畫圓要用圖形顯示,收入字符要用字符顯示,要切換顯示方式。uj5u.com熱心網友回復:
graphics.h是TC里面的圖形庫,如果要用的話應該用TC來編譯。分為:像素函式、直線和線型函式、多邊形函式、填充函式等。然而在我們使用的編譯器vc6.0和visual studio 2013編譯器中是不支持graphics.h圖形庫的,當然vc6.0和visual studio 2013編譯器也自帶了微軟的圖形庫API(也叫Windows API,它的函式基本上包含在了windows.h的頭檔案中),那么如果我們要在vc6.0和visual studio 2013中使用graphics圖形庫怎么辦?我們有兩種解決的方法。uj5u.com熱心網友回復:
多半是自己的代碼中大括號不匹配轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/26958.html
標籤:基礎類
上一篇:關于c#中建立三維網格出現的問題
下一篇:C++多執行緒問題
