设为首页 加入收藏

TOP

C/C++:多个.cpp文件包含同一个.h头文件定义方法(二)
2015-07-24 05:50:43 来源: 作者: 【 】 浏览:11
Tags:C/C 多个 .cpp 文件 包含 同一个 定义 方法
line Person::Person(istream &is) { read(is, *this); } /******************************END************************************/ #endif /* PERSON_H_ */
/*********************************************************************
 * file_name: Person.cpp
 *
 *    Created on: 2014年6月28日 下午10:55:32
 *        Author: The_Third_Wave, Blog: http://blog.csdn.net/zhanh1218
 *         Email: zhanh121823@sina.com
 * Last modified: 2014年6月28日 下午10:55:32
 *********************************************************************/
#include 
  
   
#include 
   
     #include "Person.h" using namespace std; istream &read(istream &is, Person &item) { is >> item.name >> item.age >> item.address; return is; } ostream &print(ostream &os, const Person &item) { os << item.name << " " << item.age << " " << item.address << endl; return os; } 
   
  

还有不懂的请留言。

本文由@The_Third_Wave(Blog地址:http://blog.csdn.net/zhanh1218)原创。还有未涉及的,会不定期更新,有错误请指正。

如果你看到这篇博文时发现没有不完整,那是我为防止爬虫先发布一半的原因,请看原作者Blog。

如果这篇博文对您有帮助,为了好的网络环境,不建议转载,建议收藏!如果您一定要转载,请带上后缀和本文地址。

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇SettingsProvider 之SettingsCache 下一篇zoj3080 ChiBi --- floyd求连通块..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: