windows程式設計之C 的複習!

2021-07-28 20:06:46 字數 1223 閱讀 3545

列舉型別的宣告形式:  enum  列舉型別名

值得注意的是:列舉元素按常量處理,不能賦值;列舉元素具有預設的值,依次為:0,1,2,3,...

例如: enum gameresult;

而**:enum gameresult omit = cancel;  則是定義了乙個列舉型的變數omit並給其賦值為cancel!

例如以下**:

#include

using namespace std;

enum gameresult;

int main(int argc, char *argv)

;/*clock::clock(int newh,int newm,int news)*/

void clock::settime(int newh,int newm,int news)

void clock::showtime()

point(point &p);

int getx()

int gety()

private:

int x,y;

};point::point(point &p)

point(point &p);

int getx()

int gety()

private:

int x,y;

};point::point(point &p)

line::line(line &l):p1(l.p1),p2(l.p2){

cout<<"calling the copy constructor of line"《執行結果:

calling the copy constructor of point

calling the copy constructor of point

calling the copy constructor of point

calling the copy constructor of point

calling constructor of line

calling the copy constructor of point

calling the copy constructor of point

calling the copy constructor of line

the length of the line is: 5

the length of the line2 is: 5

C語言 windows程式設計之WM CREATE

1 填寫視窗類別 註冊視窗類別 建立視窗 showwindow updatewindow 訊息迴圈 其中,createwindow函式,一旦執行起來,就不是乙個時間點,而是乙個時間段,儘管時間很短 我們說它執行以後視窗就建立起來了,並不是說它返回之前視窗就沒有建立起來,很顯然是在它執行的過程中的某個...

WINDOWS程式設計 複習(2)

可選mm anisotropic 任意 x y 可選可選 上面這個圖我是從這個部落格轉過來的。至於有什麼區別了,我覺得說不清楚,直接給上測試 吧 include lresult callback wndproc hwnd,uint,wparam,lparam int winapi winmain h...

程式設計之美複習筆記

值得注意的是thread的建構函式中指定的是函式指標 thread void work func 這樣就可以為不同的執行緒指定不同的工作函式了。回顧一下pv操作 procedure p var s samephore procedure v var s samephore 與semaphore的機制...