欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

C++開發(fā)之實(shí)現(xiàn)操作符重載的實(shí)例-創(chuàng)新互聯(lián)

C++操作符重載

成都創(chuàng)新互聯(lián)10多年成都企業(yè)網(wǎng)站建設(shè)服務(wù);為您提供網(wǎng)站建設(shè),網(wǎng)站制作,網(wǎng)頁設(shè)計(jì)及高端網(wǎng)站定制服務(wù),成都企業(yè)網(wǎng)站建設(shè)及推廣,對混凝土攪拌罐等多個(gè)領(lǐng)域擁有多年的網(wǎng)站運(yùn)維經(jīng)驗(yàn)的網(wǎng)站建設(shè)公司。

實(shí)現(xiàn)效果圖:

C++ 開發(fā)之實(shí)現(xiàn)操作符重載的實(shí)例

實(shí)例代碼:

Matrix.h

#pragma once 
#include "vector" 
#include "iostream" 
#define rep(i,n) for(int i=1;i<=n;i++) //宏定義for循環(huán),精簡代碼 
using namespace std; 
class Matrix 
{ 
public: 
  //基本構(gòu)造函數(shù) 
  Matrix(int Row=0, int Column=0); 
  //拷貝構(gòu)造函數(shù)或者復(fù)制構(gòu)造函數(shù) 
  Matrix(const Matrix& matrix); 
  //賦值操作符重載,必須為成員函數(shù),不然會報(bào)錯(cuò) 
  Matrix& operator=(const Matrix& matrix); 
  //復(fù)合賦值操作符重載,建議重載為成員函數(shù) 
  Matrix& operator+=(const Matrix& matrix); 
  Matrix& operator*=(const Matrix& matrix); 
  Matrix& operator*=(const float& number); 
  Matrix& operator*=(const int& number); 
  Matrix& operator-=(const Matrix& matrix); 
  Matrix& operator/=(const float& number); 
  float& operator[](const size_t& index); 
  Matrix& operator++();//前綴式自增 
  Matrix& operator--();//前綴式自減 
  Matrix operator++(int); //后綴式自增 
  Matrix operator--(int); //后綴式自減 
  //算術(shù)和關(guān)系操作符一般為非成員函數(shù),聲明為友元 
  friend Matrix operator+(const Matrix& matrix1, const Matrix& matrix2); 
  friend Matrix operator-(const Matrix& matrix1, const Matrix& matrix2); 
  friend Matrix operator*(const Matrix& matrix1, const Matrix& matrix2); 
  friend Matrix operator*(const Matrix& matrix1, const float& number); 
  friend Matrix operator*(const Matrix& matrix1, const int& number); 
  friend bool operator==(const Matrix& matrix1, const Matrix& matrix2); 
  friend bool operator!=(const Matrix& matrix1, const Matrix& matrix2); 
  //輸出操作符<<的重載,必須聲明為友元 
  friend ostream& operator<<(ostream& os, const Matrix&object); 
  //輸入操作符>>重載,必須聲明為友元 
  friend istream& operator >>(istream& in,Matrix&object); 
  void Display(); 
  ~Matrix(); 
public: 
  int Row; 
  int Column; 
  vector<vector<float> > data; //二維vector,用于存放矩陣類數(shù)據(jù) 
};

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)建站chinadenli.net,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

網(wǎng)頁標(biāo)題:C++開發(fā)之實(shí)現(xiàn)操作符重載的實(shí)例-創(chuàng)新互聯(lián)
地址分享:http://chinadenli.net/article22/epojc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站、手機(jī)網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、電子商務(wù)、外貿(mào)網(wǎng)站建設(shè)、響應(yīng)式網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)
情一色一区二区三区四| 国产高清一区二区不卡| 日韩在线中文字幕不卡| 欧美人与动牲交a精品| 国产在线一区二区免费| 国产日韩欧美在线播放| 亚洲熟妇熟女久久精品 | 国产大屁股喷水在线观看视频| 国产精品久久精品毛片| 99久久国产综合精品二区| 欧美在线视频一区观看| 噜噜中文字幕一区二区| 亚洲一级在线免费观看| 大香蕉网国产在线观看av| 日本二区三区在线播放| 空之色水之色在线播放| 91久久精品中文内射| 婷婷激情五月天丁香社区| 小草少妇视频免费看视频| 91亚洲国产成人久久精品麻豆| 日本午夜乱色视频在线观看| 精品日韩欧美一区久久| 日韩精品综合福利在线观看| 亚洲一区二区福利在线| 少妇视频一区二区三区| 国产欧美日产中文一区| 日韩和欧美的一区二区三区| 日本黄色高清视频久久| 国产免费自拍黄片免费看| 亚洲中文字幕在线综合视频| 一级片黄色一区二区三区| 中文字幕高清免费日韩视频| 91精品蜜臀一区二区三区| 欧美不卡一区二区在线视频| 精品推荐国产麻豆剧传媒| 激情少妇一区二区三区| 日韩黄色大片免费在线| 综合久综合久综合久久| 国产午夜精品美女露脸视频| 中文字幕日韩一区二区不卡| 国产一区欧美一区日本道|