- 博客(6)
- 收藏
- 关注
原创 C++引用的一些想法
文章目录C++引用的一些想法用不用调用copy constructor?时间C++引用的一些想法用不用调用copy constructor?直接上源码和测试结果#include <iostream>#include <string>using namespace std;class Test{private: int value;public: Test(int value_) : value(value_){ cout <&
2021-06-28 20:02:26
220
原创 C++学习笔记(三)
文章目录C++学习笔记拷贝构造运算符重载RestrictionsImplementMember function or Global function‘=’ 重载比较特殊的地方explicit右值右值引用右值传参TempleteC++学习笔记拷贝构造当传入参数的时候会发生一次拷贝构造。事实上如果返回值是也会调用拷贝构造,但现已经被优化。C++构造函数的初始化列表:如果使用初始化列表就是构造,如果不是则会先调用default construction,然后进行赋值。运算符重载Restrictio
2021-06-27 22:48:54
883
1
原创 Risc-V单周期CPU设计思考
Risc-V单周期CPU设计思考今年学校课程改革,计算机组成课开始教学Risc-V,写单周期CPU的时候发现网上好像大多都是MIPS的CPU设计,所以就把自己关于设计Verilog的一些思路整理出来。看完同学的设计之后再一次确定了我非常非常菜,本文就仅供参考。(为防影响以后的教学作业,大多数源代码已经隐去、并未将宏等解释性语言加入博客)。文章目录Risc-V单周期CPU设计思考基础指令集的实现Control模块ImmGen模块ALU Control、ALU(与Comparator)模块Instructi
2021-05-26 14:22:49
3735
2
原创 C++学习笔记(二)
文章目录构造函数的初始化Overloadinginlineconstconst与成员函数static构造函数的初始化class A{private: int i = 10; int j = 20; int k = t(i);public: A() : k(12){ cout << "i = " << i << " j = " << j << " k = " << k << endl; } int t(
2021-04-11 10:59:16
227
原创 C++学习笔记(一)
文章目录string和C的区别字符串的输入string和C的区别C++的字符串在C的基础上进行了扩充,在引入了保留字“string”的基础上,承认字符串间赋值、运算合法。char charr1[20];char charr2[20] = "string_C";string str1;string str2 = "string_Cpp";charr1 = charr2; // Invalidstr1 = str2; // Validstring str3;str3 = str1 + s
2021-03-31 14:56:11
422
原创 PTA Color the Tree
文章目录Color the TreeInput Specification思路处理输入CodeColor the TreeThere is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties:(1) Every node is either red or black.(2) The root is black.(3) E
2021-03-27 17:21:15
504
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅