簡單vc程式設計

WBOY
發布: 2024-01-16 21:54:22
轉載
562 人瀏覽過

簡單vc程式設計

簡單vc程式設計

ti.settime() 必須帶參數。 。還有,類別結束以後必須有};

class time {

int hour,minute,second;

public;

time(int h=0,int m=0,int s=0)

{hour=h;minute=m,second=s;}

void set-time(int h,int m,int s)

{hour=h;minute=m,second=s;}

void show( )

{cout

time t1( );

time t2( );

t1,show( );

t2,show( );

t1,set time (12,43,34 );

};

這樣就好了吧。不過有點小白了。 。 。

VC程式設計

#include

using namespace std;

class CPoint

{

private:

int x;

int y;

public:

void CPoint()

{

x=60;y=75;

}

void display()

{

cout

cout

}

void setPoint(int a,int b)

{

x=a;

y=b;

}

};

int main()

{

CPoint a;

a.display();

a.setPoint(80,150);

a.display();

return 0;

}

VC寫一個應用程式

void CDemoDlg::OnPaint()

{

CPaintDC dc(this); // device context for painting

RECT rect={0,400,200,20};

::DrawText (dc.m_hDC,"大方廣:", -1,&rect,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;

RECT rect1={0,440,400,20};

::DrawText (dc.m_hDC,"其身正,不令而行,其身不正,雖令不從", -1,&rect1,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;

#########################'2B ###RECT rect2={0,480,200,20};### ###::DrawText (dc.m_hDC,"行有不得,反諸己", -1,&rect2,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;### ###}###

以上是簡單vc程式設計的詳細內容。更多資訊請關注PHP中文網其他相關文章!

來源:docexcel.net
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!