C++ Data Structure 2
来源:互联网 发布:网易房产数据 上海 编辑:程序博客网 时间:2024/06/09 18:09
C++ 友元函数的简单使用。
1. *.h
include "rectangle.h"/* write function rectangle.h provides */Rectangle::Rectangle(int len,int wd,int ht){ length=len; width=wd; height=ht;}int Volume(Rectangle oRectangle){ return oRectangle.length*oRectangle.width*oRectangle.height;}
2.*.cpp
#include "rectangle.h"/* write function rectangle.h provides */Rectangle::Rectangle(int len,int wd,int ht){ length=len; width=wd; height=ht;}int Volume(Rectangle oRectangle){ return oRectangle.length*oRectangle.width*oRectangle.height;}
3.main.cpp
#include<stdlib.h>#include<iostream>using namespace std;#include "rectangle.h"int main(void){ Rectangle thisRectangle(6,7,9); int volume=Volume(thisRectangle); cout <<"Score is:_"<<volume<<endl; system("PAUSE"); return 0;}
- Data Structure(2)
- C++ Data Structure 2
- Data Structure Alignment 2
- 42 data structure day-2
- Data Structure(with C).Experiment01.01
- Data Structure(with C).Experiment01.02
- PCM data flow - 2 - ASoC data structure
- Data Structure
- Data structure
- Data Structure
- Data structure
- Data structure
- data structure
- Data Structure
- Data structure
- Data Structure
- Data Structure
- Data Structure
- 二叉树的遍历(非递归算法)
- c++实现List数据结构
- org.tigris.subversion.javahl.ClientException: RA layer request failed s
- 字符数组和字符串指针
- 安装pfsense2.1光驱问题
- C++ Data Structure 2
- 深入浅出Node.js(一):什么是Node.js
- 虚函数
- java基础——泛型(jdk1.5新特性)
- JS的验证信息
- unity3d 生命槽的设置
- 教学任重道远 专家“保驾护航”——国家外专局特派专家提升AYC培训质量
- hdu - 3260 - Facer is learning to swim(dfs)
- linux命令连接符与替换符