
C++
文章平均质量分 65
C++
魔方研究生
这个作者很懒,什么都没留下…
展开
-
C++类的六个特殊成员函数20220226
------------------------------------------------1.设置六个函数的参数,先让函数运行起来1.1 test/Student.h#include <iostream>class Stu {private: std::string name = "无名氏"; int age = 18;public: Stu(); Stu(std::string name, int age); Stu(cons原创 2022-02-26 18:40:10 · 495 阅读 · 0 评论 -
C++的list和vector的三种循环遍历方式
list的三种循环遍历方式// int的类型#include <iostream>#include <list>//using namespace std;int main() {//================================================================= std::list<int&...原创 2020-03-26 22:02:52 · 9107 阅读 · 0 评论 -
学习CMake(一)
首先要知道的几个重要命令# https://cmake.org/cmake/help/v3.14/find_file() 重点:找到文件的全路径(包含文件名)(查找需要全称),默认路径是CMAKE_INCLUDE_PATHfind_path() 重点:找到文件的文件夹路径(查找需要全称),默认路径是CMAKE_INCLUDE_PATHfind_library() 重点:找到文件的全路...原创 2020-03-25 12:02:53 · 684 阅读 · 0 评论 -
C++的选择结构if-else
C++的选择结构if-else//// Created by liuhao on 20-2-9.//#include <iostream>int main() { int a = 5;//========================================================= // 两个分支无括号 if (a <...原创 2020-03-08 13:35:30 · 380 阅读 · 0 评论 -
C++的字面量运算符重载literal operator
literal operator字面量运算符重载// 这种形式是通过重载operator ""(双引号)后缀运算符实现的(称为literal operator,字面量运算符)/*C++11新特性之用户字面量操作符https://blog.youkuaiyun.com/jxianxu/article/details/80641810在C++11标准中,对字面量操作符的使用定了一些规则:1. 如...原创 2020-03-08 13:33:00 · 2969 阅读 · 0 评论 -
C++和Python的时间函数模板代码
C++ 日期 & 时间导入#include <unistd.h>头文件cmake_minimum_required(VERSION 3.14)project(test)set(CMAKE_CXX_STANDARD 11)add_executable(test test.cpp)// TODO 时间函数模板代码#include <iostream&...原创 2020-03-08 13:31:55 · 200 阅读 · 0 评论