首页 > 编程语言 > 详细

c++ 的 static_cast

时间:2016-05-12 06:48:15      阅读:165      评论:0      收藏:0      [点我收藏+]

http://www.cnblogs.com/pigerhan/archive/2013/02/26/2933590.html

 

#include "Person.h"
#include <string>
#include <iostream>

Person::Person()
{

}
void Person::sayHello()
{
    std::cout << "hello world";
}


int main(void)
{
    Humankind humanKind = Humankind();
    humanKind.sayHello();

    Person person = static_cast<Person>(humanKind);

    humanKind.sayHello();
    person.sayHello();
    std::cin.get();
}

 

c++ 的 static_cast

原文:http://www.cnblogs.com/heben/p/5484214.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!