首页  >  文章  >  电脑教程  >  简单vc程序设计

简单vc程序设计

WBOY
WBOY转载
2024-01-16 21:54:22562浏览

简单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 ) ;

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删除