梦幻之旅

DEBUG - 天道酬勤

   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  671 随笔 :: 6 文章 :: 256 评论 :: 0 Trackbacks
Persion.h
#include <string>
using namespace std;

#ifndef PERSION_H
#define PERSION_H
class Persion
{
private:
    
string name;
public:
    Persion(
string name);
    
void say();
}
;
#endif
Persion.cpp
#include <iostream>
#include 
<string>
#include 
"Persion.h"
using namespace std;
Persion::Persion(
string name)
{
    
this->name=name;
}

void Persion::say()
{
    cout
<<"my name is "<<this->name<<endl;
}

void main()
{
    Persion persion(
"huyvanpull");
    Persion 
*pPersion = &persion;
    pPersion
->say();
}

posted on 2009-07-02 21:04 HUIKK 阅读(201) 评论(0)  编辑  收藏 所属分类: C/C++

只有注册用户登录后才能发表评论。


网站导航: