会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
hinaou
博客园
首页
新随笔
联系
订阅
管理
2024年12月18日
实验6 模板类、文件I/O与异常处理
摘要: 实验四 vector.hpp #pragma once #include<iostream> #include<stdexcept> using namespace std; template<typename T> class Vector { private: int size; T* ptr;
阅读全文
posted @ 2024-12-18 21:26 hinaou
阅读(13)
评论(0)
推荐(0)
2024年12月3日
实验5 继承和多态
摘要: 实验三 test.cpp #include <iostream> #include <vector> #include "pets.hpp" void test() { using namespace std; vector<MachinePets *> pets; pets.push_back(n
阅读全文
posted @ 2024-12-03 17:27 hinaou
阅读(17)
评论(0)
推荐(0)
2024年11月21日
实验4 类的组合、继承、模板类、标准库
摘要: 实验2 GradeCalc.hpp #include <iostream> #include <vector> #include <string> #include <algorithm> #include <numeric> #include <iomanip> using std::vector
阅读全文
posted @ 2024-11-21 12:00 hinaou
阅读(24)
评论(0)
推荐(0)
2024年11月6日
实验3 类和对象 基础编程
摘要: 实验一 task1.cpp #include "window.hpp" #include <iostream> using std::cout; using std::cin; void test() { Window w1("new window"); w1.add_button("maximiz
阅读全文
posted @ 2024-11-06 20:31 hinaou
阅读(17)
评论(0)
推荐(0)
2024年10月24日
实验2 类与对象 基础编程
摘要: 实验一: t.h: #pragma once #include <string> // 类T: 声明 class T { // 对象属性、方法 public: T(int x = 0, int y = 0); // 普通构造函数 T(const T &t); // 复制构造函数 T(T &&t);
阅读全文
posted @ 2024-10-24 14:43 hinaou
阅读(18)
评论(0)
推荐(0)
2024年10月10日
实验1 现代c++编程初体验
摘要: 实验1: 1 // 现代C++标准库、算法库体验 2 // 本例用到以下内容: 3 // 1. 字符串string, 动态数组容器类vector、迭代器 4 // 2. 算法库:反转元素次序、旋转元素 5 // 3. 函数模板、const引用作为形参 6 7 #include <iostream>
阅读全文
posted @ 2024-10-10 23:19 hinaou
阅读(20)
评论(0)
推荐(0)
公告