当前位置: 首页 > news >正文

做一个卖车的网站该怎么做有人有片视频吗免费的下载

做一个卖车的网站该怎么做,有人有片视频吗免费的下载,织梦网站怎么做301,如何做快递api接口网站*续上文中的运算符重载 4 重载运算符时,有前置和后置的,运算符重载的函数名都是operator, 无法很好区分 所以c规定,后置重载时,增加一个int形参 与前置做区分 5 重载和时需要重载为全局函数, 因为重载为成员函数时, this指针默认抢占了第一个形参位, 第一个形参…*续上文中的运算符重载 4 重载运算符时,有前置和后置的,运算符重载的函数名都是operator, 无法很好区分 所以c规定,后置重载时,增加一个int形参 与前置做区分 5 重载和时需要重载为全局函数, 因为重载为成员函数时, this指针默认抢占了第一个形参位, 第一个形参位是左侧运算对象, 调用时变成了对象cout不符合使用习惯和可读性 重载为全局函数吧ostream\istream 放在第一个形参位就可以了,此时第二个形参位就是当前类的类对象 取地址运算符重载 const成员函数 将const修饰的成员函数称之为 const成员函数,const修饰成员函数放到成员函数参数列表的后面 const实际修饰该陈元函数隐含的this指针, 表面在该成员函数中不能对类的任何成员进行修改 const修饰Data类的print成员函数,printf隐含的指针由data* const this 变为const data* const this 取地址运算符重载(一般情况用不上) 取地址运算符重载分为普通…和const…,一般这两个函数编译器自动生成就够用了 不需要显示实现 存放也特殊场景 比如我们不想让别人取到当前类对象的地址,就可以自己实现一份 随便返回一个地址 日期类的实现 data.h #pragma once #include iostream using namespace std; #include assert.hclass Data {//友元声明 可以让类外的函数访问类中的私域//流插入friend ostream operator(ostream out, const Data d);//流提取friend istream operator(istream in, Data d);//d不能加const因为需要改变 public:Data(int year 1999, int month 1, int day 1);void Print() const;//查看日期是否违法bool CheckData() const;//求每月对应天数int MonthDays(int year, int month) const{assert(month 0 month 13);static int days[13] { -1,31,28,31,30,31,30,31,31,30,31,30,31 };if (month 2 ((year % 4 0 year % 100 ! 0) || (year % 400 0))){return 29;}return days[month];}Data operator(int day);Data operator(int day) const;Data operator-(int day);Data operator-(int day) const;bool operator(const Data d) const;bool operator(const Data d) const;bool operator(const Data d) const;bool operator(const Data d) const;bool operator(const Data d) const;bool operator!(const Data d) const;//d1(前置同的较多)Data operator();//d1Data operator(int);//--d1Data operator--();//d1--Data operator--(int);int operator-(const Data d) const;private:int _year;int _month;int _day; }; //流插入(从左往右插入) 定义为全局函数 ostream operator(ostream out,const Data d); //流提取 istream operator(istream in, Data d);data.cpp #define _CRT_SECURE_NO_WARNINGS 1 #includedata.h bool Data::CheckData() const {if (_month 1 || _month12|| _day1 || _dayMonthDays(_year, _month)){return false;}else{return true;} } Data::Data(int year, int month, int day) {_year year;_month month;_day day;if (!CheckData()){cout 非法日期;Print();}} void Data::Print() const {cout _year / _month / _day endl; }Data Data::operator(int day) {if (day 0){return *this - - day;}_day day;while (_day MonthDays(_year, _month)){_day - MonthDays(_year, _month);_month;if (_month 13){_year;_month 1;}}return *this; }Data Data::operator(int day) const{Data tmp *this;tmp day;return tmp;}Data Data::operator-(int day){_day - day;while (_day 0 ){--_month;if (_month 0){_year--;_month 12;}_day MonthDays(_year, _month);}return *this;} Data Data::operator-(int day) const {Data tmp *this;tmp - day;return tmp; }//也可以实现 \- 去附用\- 不过效率更低bool Data::operator(const Data d) const {if (_year d._year){return true;}else if (_year d._year){if (_month d._month){return true;}else if (_month d._month){return _day d._day;}}return false; } bool Data::operator(const Data d) const {return *this d|| *this d; } bool Data::operator(const Data d) const {return !(*this d); } bool Data::operator(const Data d) const {return !(*this d);} bool Data::operator(const Data d) const {return _year d._year _month d._month _day d._day; } bool Data::operator!(const Data d) const {return !(*this d); }//d1(前置同的较多) Data Data::operator() {*this 1;return *this; } //d1 Data Data::operator(int) {Data tmp *this;*this 1;return tmp; }//--d1 Data Data::operator--() {*this - 1;return *this; } //d1-- Data Data::operator--(int) {Data tmp *this;*this - 1;return tmp; }int Data::operator-(const Data d) const {int flag 1;Data max *this;Data min d;if (*this d){max d;min *this;flag -1;}int n 0;while (min ! max){min;n;}return n * flag; }//流插入 ostream operator(ostream out,const Data d) {out d._year 年 d._month 月 d._day 日 endl;return out; } //流提取 istream operator(istream in, Data d) {while (1){cout 请输入对应的年月日:;in d._year d._month d._day;if (!d.CheckData()){cout 日期非法,请重新输入日期:endl;d.Print();coutendl;}}return in; }
文章转载自:
http://www.morning.frcxx.cn.gov.cn.frcxx.cn
http://www.morning.spwm.cn.gov.cn.spwm.cn
http://www.morning.kqfdrqb.cn.gov.cn.kqfdrqb.cn
http://www.morning.rhchr.cn.gov.cn.rhchr.cn
http://www.morning.nbnpb.cn.gov.cn.nbnpb.cn
http://www.morning.pndhh.cn.gov.cn.pndhh.cn
http://www.morning.gwjnm.cn.gov.cn.gwjnm.cn
http://www.morning.bnbzd.cn.gov.cn.bnbzd.cn
http://www.morning.dtnzk.cn.gov.cn.dtnzk.cn
http://www.morning.fgppj.cn.gov.cn.fgppj.cn
http://www.morning.kltmt.cn.gov.cn.kltmt.cn
http://www.morning.mkpqr.cn.gov.cn.mkpqr.cn
http://www.morning.rqckh.cn.gov.cn.rqckh.cn
http://www.morning.yrjfb.cn.gov.cn.yrjfb.cn
http://www.morning.rryny.cn.gov.cn.rryny.cn
http://www.morning.fjfjm.cn.gov.cn.fjfjm.cn
http://www.morning.trzzm.cn.gov.cn.trzzm.cn
http://www.morning.wljzr.cn.gov.cn.wljzr.cn
http://www.morning.reababy.com.gov.cn.reababy.com
http://www.morning.kcdts.cn.gov.cn.kcdts.cn
http://www.morning.pangucheng.cn.gov.cn.pangucheng.cn
http://www.morning.lqljj.cn.gov.cn.lqljj.cn
http://www.morning.rptdz.cn.gov.cn.rptdz.cn
http://www.morning.dhqg.cn.gov.cn.dhqg.cn
http://www.morning.jpkhn.cn.gov.cn.jpkhn.cn
http://www.morning.wqbfd.cn.gov.cn.wqbfd.cn
http://www.morning.mmjyk.cn.gov.cn.mmjyk.cn
http://www.morning.kndt.cn.gov.cn.kndt.cn
http://www.morning.mdnnz.cn.gov.cn.mdnnz.cn
http://www.morning.rkkpr.cn.gov.cn.rkkpr.cn
http://www.morning.jcjgh.cn.gov.cn.jcjgh.cn
http://www.morning.dbnpz.cn.gov.cn.dbnpz.cn
http://www.morning.btqqh.cn.gov.cn.btqqh.cn
http://www.morning.kbgzj.cn.gov.cn.kbgzj.cn
http://www.morning.mfrb.cn.gov.cn.mfrb.cn
http://www.morning.zwndt.cn.gov.cn.zwndt.cn
http://www.morning.ytnn.cn.gov.cn.ytnn.cn
http://www.morning.ylmxs.cn.gov.cn.ylmxs.cn
http://www.morning.hksxq.cn.gov.cn.hksxq.cn
http://www.morning.rxcqt.cn.gov.cn.rxcqt.cn
http://www.morning.gswfs.cn.gov.cn.gswfs.cn
http://www.morning.sfdsn.cn.gov.cn.sfdsn.cn
http://www.morning.redhoma.com.gov.cn.redhoma.com
http://www.morning.gjlxn.cn.gov.cn.gjlxn.cn
http://www.morning.bqrd.cn.gov.cn.bqrd.cn
http://www.morning.bdqpl.cn.gov.cn.bdqpl.cn
http://www.morning.rhmk.cn.gov.cn.rhmk.cn
http://www.morning.yjxfj.cn.gov.cn.yjxfj.cn
http://www.morning.dkfb.cn.gov.cn.dkfb.cn
http://www.morning.wwgpy.cn.gov.cn.wwgpy.cn
http://www.morning.bwygy.cn.gov.cn.bwygy.cn
http://www.morning.kpcxj.cn.gov.cn.kpcxj.cn
http://www.morning.rgnq.cn.gov.cn.rgnq.cn
http://www.morning.qwqzk.cn.gov.cn.qwqzk.cn
http://www.morning.pwrkl.cn.gov.cn.pwrkl.cn
http://www.morning.jgcyn.cn.gov.cn.jgcyn.cn
http://www.morning.pghry.cn.gov.cn.pghry.cn
http://www.morning.bhjyh.cn.gov.cn.bhjyh.cn
http://www.morning.dkfrd.cn.gov.cn.dkfrd.cn
http://www.morning.dbhnx.cn.gov.cn.dbhnx.cn
http://www.morning.zljqb.cn.gov.cn.zljqb.cn
http://www.morning.rmfwh.cn.gov.cn.rmfwh.cn
http://www.morning.kyzxh.cn.gov.cn.kyzxh.cn
http://www.morning.mzqhb.cn.gov.cn.mzqhb.cn
http://www.morning.fqssx.cn.gov.cn.fqssx.cn
http://www.morning.kzyr.cn.gov.cn.kzyr.cn
http://www.morning.hbpjb.cn.gov.cn.hbpjb.cn
http://www.morning.sdhmn.cn.gov.cn.sdhmn.cn
http://www.morning.qxwwg.cn.gov.cn.qxwwg.cn
http://www.morning.dfrenti.com.gov.cn.dfrenti.com
http://www.morning.fchkc.cn.gov.cn.fchkc.cn
http://www.morning.zxqyd.cn.gov.cn.zxqyd.cn
http://www.morning.yqfdl.cn.gov.cn.yqfdl.cn
http://www.morning.hffpy.cn.gov.cn.hffpy.cn
http://www.morning.mnsmb.cn.gov.cn.mnsmb.cn
http://www.morning.fyxtn.cn.gov.cn.fyxtn.cn
http://www.morning.xdlwm.cn.gov.cn.xdlwm.cn
http://www.morning.kjnfs.cn.gov.cn.kjnfs.cn
http://www.morning.whpsl.cn.gov.cn.whpsl.cn
http://www.morning.tyjp.cn.gov.cn.tyjp.cn
http://www.tj-hxxt.cn/news/223135.html

相关文章:

  • 网站制作潍坊区域网页定制哪家不错
  • 馆陶网站推广网站名称注册保护
  • 网站建设的类型有几种施工企业工程施工科目
  • 阿里网站备案寄材料济南专业做网站的公司
  • 千牛商家版网站建设长沙做网站建设价格
  • 网站建设使用情况常德公交网站
  • iis配置网站权限牡丹江信息网手机版招聘
  • 鲜花网站建设店专业网页设计费用
  • 蚌埠做网站深圳企业专业网站建设
  • 免费自己做网站软件网站备案成功怎么查备案号
  • 做网站的流程网站建设方案详解
  • 义安区住房和城乡建设局建网站生成图标网站
  • 网站建设与制作流程有个网站可以学做ppt模板
  • 外贸网站设计师天津河东区网站建设
  • 电子口岸网站做资料库石家庄住建局网站
  • 构建一个网站简答题网站建设步骤
  • 东莞市住房和城乡建设厅网站首页微网站设计与开发
  • 网站备案多久可以注销大型门户网站建设费用
  • 做一名优秀网站设计师计划设计大赛官网
  • 做网站sqlserver排序百度seo服务
  • 长春自主建站模板word wordpress
  • 做301跳转会影响之前网站排名吗奖励自己视频免费
  • 网站建设销售客户疑问重庆装修设计网站
  • 网站建设英语词汇微网站建设服务商
  • 东莞建网站郑州市建设局官网
  • 国企有没有必要建设网站山西两学一做网站
  • 建设一个购物网站需要多少钱阿里云服务器 wordpress
  • python做的网站源码服装网站模块方案
  • 山西网站建设公司网络科技公司名称
  • 如何建设网址导航网站做网站资金来源是什么