-
实验05
1.实验任务1 publisher.hpp #pragma once #include<string> class Publisher{ public: Publisher(const std::string &name_=""); virtual ~Publisher()=default; pub -
实验五
任务1: 问题1. (1) Publish存在纯虚函数talk() (2) 不能,抽象类无法实例化 问题2. (1) publish和use两个函数, virtual void publish() = 0 ; (2) 问题3. (1) Publish* (2) Book,Film,Music (3) -
实验5
一、实验结论 1. 实验任务1 程序源代码 Publisher.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &n -
实验5 多态
实验5 实验任务1 源代码 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string &name_ = -
实验5
任务1: #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &name_): name {name_} { } -
实验5
1.实验任务1 Publisher.cpp 点击查看代码 #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &n -
实验5
任务一: publisher.hpp 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string &na -
实验5 多态
1. 实验任务1 publisher.hpp 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string -
实验5 多态
实验一: 代码:task1.cpp: #include <memory> #include <iostream> #include <vector> #include "publisher.hpp" void test1() { std::vector<Publisher *> v; v.push_ -
实验5 多态
实验任务1 实验代码: publisher.hpp: #pragma once #include <string> class Publisher { public: Publisher(const std::string& name_ = ""); virtual ~Publisher() = d -
实验五
任务一: 源代码: 1 #include <memory> 2 #include <iostream> 3 #include <vector> 4 #include "publisher.hpp" 5 6 void test1() { 7 std::vector<Publisher *> v; 8 -
OOP-实验5
一、任务1 1、源代码: publish.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); -
实验5
##实验任务1 #代码 publisher.hpp 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::str -
c++ 5
##task1 #代码 1 #include <iostream> 2 #include <string> 3 #include "publisher.hpp" 4 5 // Publisher类:实现 6 Publisher::Publisher(const std::string &name_) -
实验5
实验5 实验任务1 publisher.cpp #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &name_) -
实验5
任务一: 1.源代码: (1)publisher.hpp: #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = -
实验五
实验任务1 源代码如下: publisher.hpp 点击查看代码 #pragma once #include <string> class Publisher { public: Publisher(const std::string &name_ = ""); virtual ~Publishe -
实验5
实验五 实验任务一 代码 publisher.cpp #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &nam -
实验五
任务一: 源代码task1.cpp #include <memory> #include <iostream> #include <vector> #include "publisher.hpp" void test1() { std::vector<Publisher *> v; v.push_b -
实验五
TASK1 publisher.cpp 点击查看代码 #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &nam