博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
《C++ Primer Plus(第6版)》14章 C++代码复用 - 代码清单14.3
阅读量:4588 次
发布时间:2019-06-09

本文共 705 字,大约阅读时间需要 2 分钟。

学习C++类代码复用,将代码清单14.3

1 Student ada[pupils] =

 { Student(quizzes),Student(quizzes) ,Student(quizzes)};

修改为

2 Student ada[pupils] =

 { Student[quizzes],Student[quizzes] ,Student[quizzes]};

出现的错误图中所示:

1 表示Student ada 3(pupils)个对象,每个对象均为Student(quizzes),调用explicit Student(const std::string & s) :name("Nully"), scores() {}???还是

explicit Student(int n) :name("Nully"), scores() {}

2 表示Student ada 3(pupils)个对象,每个对象均为Student[quizzes],对象重复包含;

2019/6/18

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

转载于:https://www.cnblogs.com/huhuhusanling/p/11045051.html

你可能感兴趣的文章
Oracle Metadata
查看>>
jquery 实现3d切割轮播图
查看>>
学习spring cloud 笔记
查看>>
字符串截取,SubString
查看>>
Android: 网络随时需要在3G和Wifi切换,网络程序需要注意
查看>>
ajax调用servlet
查看>>
IText 生成横向的doc文档
查看>>
认识了个外国友人!
查看>>
对Cookie进行增删改查
查看>>
MySQL sql语句获取当前日期|时间|时间戳
查看>>
微信支付官方SDK V3 .NET版的坑
查看>>
Python(一)list tuple dict set
查看>>
什么是死锁,简述死锁发生的四个必要条件,如何避免与预防死锁
查看>>
hdu4651(广义五边形数 & 分割函数1)
查看>>
python iter,迭代器&dict,字典详解
查看>>
python笔记1
查看>>
C语言:自定义一个查找字串的功能函数,类似于<string.h>中的strstr()
查看>>
数据库联系 创建表格:重点
查看>>
Regist
查看>>
设置磁盘配额(第二版)
查看>>