├── .DS_Store
├── .gitattributes
├── C++ Primer笔记.md
├── C++力扣刷题.md
├── Code
├── .idea
│ ├── .gitignore
│ ├── .name
│ ├── Chapter3.iml
│ ├── misc.xml
│ ├── modules.xml
│ └── vcs.xml
├── Chapter3
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── Chapter3.iml
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ └── vcs.xml
│ ├── CMakeLists.txt
│ ├── StringConstructor.cpp
│ ├── StringConstructor.h
│ ├── TypeConversion.cpp
│ ├── TypeConversion.h
│ ├── VectorConstructor.cpp
│ ├── VectorConstructor.h
│ ├── arrayTest.cpp
│ ├── arrayTest.h
│ ├── cmake-build-debug
│ │ ├── CMakeCache.txt
│ │ ├── CMakeFiles
│ │ │ ├── 3.19.2
│ │ │ │ ├── CMakeCCompiler.cmake
│ │ │ │ ├── CMakeCXXCompiler.cmake
│ │ │ │ ├── CMakeDetermineCompilerABI_C.bin
│ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin
│ │ │ │ ├── CMakeSystem.cmake
│ │ │ │ ├── CompilerIdC
│ │ │ │ │ ├── CMakeCCompilerId.c
│ │ │ │ │ └── a.out
│ │ │ │ └── CompilerIdCXX
│ │ │ │ │ ├── CMakeCXXCompilerId.cpp
│ │ │ │ │ └── a.out
│ │ │ ├── CMakeDirectoryInformation.cmake
│ │ │ ├── CMakeOutput.log
│ │ │ ├── Chapter3.dir
│ │ │ │ ├── CXX.includecache
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── StringConstructor.cpp.o
│ │ │ │ ├── TypeConversion.cpp.o
│ │ │ │ ├── VectorConstructor.cpp.o
│ │ │ │ ├── arrayTest.cpp.o
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.internal
│ │ │ │ ├── depend.make
│ │ │ │ ├── flags.make
│ │ │ │ ├── iteratorUsing.cpp.o
│ │ │ │ ├── link.txt
│ │ │ │ ├── main.cpp.o
│ │ │ │ └── progress.make
│ │ │ ├── Makefile.cmake
│ │ │ ├── Makefile2
│ │ │ ├── TargetDirectories.txt
│ │ │ ├── clion-environment.txt
│ │ │ ├── clion-log.txt
│ │ │ ├── cmake.check_cache
│ │ │ └── progress.marks
│ │ ├── Chapter3
│ │ ├── Chapter3.cbp
│ │ ├── Makefile
│ │ ├── Testing
│ │ │ └── Temporary
│ │ │ │ └── LastTest.log
│ │ └── cmake_install.cmake
│ ├── iteratorUsing.cpp
│ ├── iteratorUsing.h
│ └── main.cpp
├── Chapter4
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── Chapter4.iml
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ └── vcs.xml
│ ├── CMakeLists.txt
│ ├── cmake-build-debug
│ │ ├── CMakeCache.txt
│ │ ├── CMakeFiles
│ │ │ ├── 3.19.2
│ │ │ │ ├── CMakeCCompiler.cmake
│ │ │ │ ├── CMakeCXXCompiler.cmake
│ │ │ │ ├── CMakeDetermineCompilerABI_C.bin
│ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin
│ │ │ │ ├── CMakeSystem.cmake
│ │ │ │ ├── CompilerIdC
│ │ │ │ │ ├── CMakeCCompilerId.c
│ │ │ │ │ └── a.out
│ │ │ │ └── CompilerIdCXX
│ │ │ │ │ ├── CMakeCXXCompilerId.cpp
│ │ │ │ │ └── a.out
│ │ │ ├── CMakeCXXCompilerId.dir
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.make
│ │ │ │ ├── flags.make
│ │ │ │ ├── link.txt
│ │ │ │ └── progress.make
│ │ │ ├── CMakeDirectoryInformation.cmake
│ │ │ ├── CMakeOutput.log
│ │ │ ├── Chapter4.dir
│ │ │ │ ├── CXX.includecache
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.internal
│ │ │ │ ├── depend.make
│ │ │ │ ├── flags.make
│ │ │ │ ├── link.txt
│ │ │ │ ├── main.cpp.o
│ │ │ │ └── progress.make
│ │ │ ├── Makefile.cmake
│ │ │ ├── Makefile2
│ │ │ ├── TargetDirectories.txt
│ │ │ ├── clion-environment.txt
│ │ │ ├── clion-log.txt
│ │ │ ├── cmake.check_cache
│ │ │ ├── exercise5_14.dir
│ │ │ │ ├── CXX.includecache
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.internal
│ │ │ │ ├── depend.make
│ │ │ │ ├── exercise5_14.cpp.o
│ │ │ │ ├── flags.make
│ │ │ │ ├── link.txt
│ │ │ │ └── progress.make
│ │ │ ├── exercise5_19.dir
│ │ │ │ ├── CXX.includecache
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.internal
│ │ │ │ ├── depend.make
│ │ │ │ ├── exercise5_19.cpp.o
│ │ │ │ ├── flags.make
│ │ │ │ ├── link.txt
│ │ │ │ └── progress.make
│ │ │ ├── exercise5_20.dir
│ │ │ │ ├── CXX.includecache
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.internal
│ │ │ │ ├── depend.make
│ │ │ │ ├── exercise5_14.cpp.o
│ │ │ │ ├── exercise5_20.cpp.o
│ │ │ │ ├── flags.make
│ │ │ │ ├── link.txt
│ │ │ │ └── progress.make
│ │ │ ├── exercise5_23_24_25.dir
│ │ │ │ ├── CXX.includecache
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.internal
│ │ │ │ ├── depend.make
│ │ │ │ ├── exercise5_23_24_25.cpp.o
│ │ │ │ ├── flags.make
│ │ │ │ ├── link.txt
│ │ │ │ └── progress.make
│ │ │ ├── exerise5_20.dir
│ │ │ │ ├── CXX.includecache
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.internal
│ │ │ │ ├── depend.make
│ │ │ │ ├── exercise5_14.cpp.o
│ │ │ │ ├── exerise5_20.cpp.o
│ │ │ │ ├── flags.make
│ │ │ │ ├── link.txt
│ │ │ │ └── progress.make
│ │ │ ├── main.dir
│ │ │ │ ├── CXX.includecache
│ │ │ │ ├── DependInfo.cmake
│ │ │ │ ├── build.make
│ │ │ │ ├── cmake_clean.cmake
│ │ │ │ ├── depend.internal
│ │ │ │ ├── depend.make
│ │ │ │ ├── exercise5_14.cpp.o
│ │ │ │ ├── flags.make
│ │ │ │ ├── link.txt
│ │ │ │ ├── main.cpp.o
│ │ │ │ └── progress.make
│ │ │ └── progress.marks
│ │ ├── Chapter4
│ │ ├── Chapter4.cbp
│ │ ├── Makefile
│ │ ├── Testing
│ │ │ └── Temporary
│ │ │ │ └── LastTest.log
│ │ ├── cmake_install.cmake
│ │ ├── exercise5_14
│ │ ├── exercise5_19
│ │ ├── exercise5_20
│ │ └── exercise5_23_24_25
│ ├── exercise5_14.cpp
│ ├── exercise5_14.h
│ ├── exercise5_19.cpp
│ ├── exercise5_19.h
│ ├── exercise5_20.cpp
│ ├── exercise5_20.h
│ ├── exercise5_23_24_25.cpp
│ ├── exercise5_23_24_25.h
│ └── main.cpp
└── Chapter5
│ ├── .idea
│ ├── .gitignore
│ ├── Chapter5.iml
│ ├── misc.xml
│ ├── modules.xml
│ └── vcs.xml
│ ├── CMakeLists.txt
│ ├── cmake-build-debug
│ ├── CMakeCache.txt
│ ├── CMakeFiles
│ │ ├── 3.19.2
│ │ │ ├── CMakeCCompiler.cmake
│ │ │ ├── CMakeCXXCompiler.cmake
│ │ │ ├── CMakeDetermineCompilerABI_C.bin
│ │ │ ├── CMakeDetermineCompilerABI_CXX.bin
│ │ │ ├── CMakeSystem.cmake
│ │ │ ├── CompilerIdC
│ │ │ │ ├── CMakeCCompilerId.c
│ │ │ │ └── a.out
│ │ │ └── CompilerIdCXX
│ │ │ │ ├── CMakeCXXCompilerId.cpp
│ │ │ │ └── a.out
│ │ ├── CMakeCXXCompilerId.dir
│ │ │ ├── DependInfo.cmake
│ │ │ ├── build.make
│ │ │ ├── cmake_clean.cmake
│ │ │ ├── depend.make
│ │ │ ├── flags.make
│ │ │ ├── link.txt
│ │ │ └── progress.make
│ │ ├── CMakeDirectoryInformation.cmake
│ │ ├── CMakeOutput.log
│ │ ├── Chapter5.dir
│ │ │ ├── CXX.includecache
│ │ │ ├── DependInfo.cmake
│ │ │ ├── build.make
│ │ │ ├── cmake_clean.cmake
│ │ │ ├── depend.internal
│ │ │ ├── depend.make
│ │ │ ├── flags.make
│ │ │ ├── link.txt
│ │ │ ├── main.cpp.o
│ │ │ └── progress.make
│ │ ├── Makefile.cmake
│ │ ├── Makefile2
│ │ ├── TargetDirectories.txt
│ │ ├── clion-environment.txt
│ │ ├── clion-log.txt
│ │ ├── cmake.check_cache
│ │ ├── exericse6_4.dir
│ │ │ ├── CXX.includecache
│ │ │ ├── DependInfo.cmake
│ │ │ ├── build.make
│ │ │ ├── cmake_clean.cmake
│ │ │ ├── depend.internal
│ │ │ ├── depend.make
│ │ │ ├── exericse6_4.cpp.o
│ │ │ ├── flags.make
│ │ │ ├── link.txt
│ │ │ └── progress.make
│ │ ├── main.dir
│ │ │ ├── DependInfo.cmake
│ │ │ ├── build.make
│ │ │ ├── cmake_clean.cmake
│ │ │ ├── depend.make
│ │ │ ├── flags.make
│ │ │ ├── link.txt
│ │ │ └── progress.make
│ │ └── progress.marks
│ ├── Chapter5
│ ├── Chapter5.cbp
│ ├── Makefile
│ ├── Testing
│ │ └── Temporary
│ │ │ └── LastTest.log
│ ├── cmake_install.cmake
│ └── exericse6_4
│ ├── exericse6_4.cpp
│ ├── exericse6_4.h
│ └── main.cpp
├── Primer C++(第5版).pdf
├── README.md
├── STL标准库与泛型编程【侯捷】
└── STL标准库与泛型编程.pdf
├── c++11新特性【侯捷】
├── C++新标准C++11_14.pdf
└── c++11特性-笔记.md
└── c++高级开发【侯捷】
├── .DS_Store
├── C++面向对象程序设计 - 笔记.md
├── C++面向对象程序设计 - 笔记.pdf
├── code
├── .idea
│ ├── .gitignore
│ ├── code.iml
│ ├── misc.xml
│ ├── modules.xml
│ └── vcs.xml
├── C++OOP2-ex.cpp
├── CMakeLists.txt
├── cmake-build-debug
│ ├── CMakeCache.txt
│ ├── CMakeFiles
│ │ ├── 3.17.3
│ │ │ ├── CMakeCCompiler.cmake
│ │ │ ├── CMakeCXXCompiler.cmake
│ │ │ ├── CMakeDetermineCompilerABI_C.bin
│ │ │ ├── CMakeDetermineCompilerABI_CXX.bin
│ │ │ ├── CMakeSystem.cmake
│ │ │ ├── CompilerIdC
│ │ │ │ ├── CMakeCCompilerId.c
│ │ │ │ └── a.out
│ │ │ └── CompilerIdCXX
│ │ │ │ ├── CMakeCXXCompilerId.cpp
│ │ │ │ └── a.out
│ │ ├── CMakeDirectoryInformation.cmake
│ │ ├── CMakeOutput.log
│ │ ├── Makefile.cmake
│ │ ├── Makefile2
│ │ ├── TargetDirectories.txt
│ │ ├── clion-environment.txt
│ │ ├── clion-log.txt
│ │ ├── cmake.check_cache
│ │ ├── code.dir
│ │ │ ├── CXX.includecache
│ │ │ ├── DependInfo.cmake
│ │ │ ├── build.make
│ │ │ ├── cmake_clean.cmake
│ │ │ ├── complex_test.cpp.o
│ │ │ ├── depend.internal
│ │ │ ├── depend.make
│ │ │ ├── flags.make
│ │ │ ├── link.txt
│ │ │ ├── main.cpp.o
│ │ │ ├── progress.make
│ │ │ └── string_test.cpp.o
│ │ └── progress.marks
│ ├── Makefile
│ ├── cmake_install.cmake
│ ├── code
│ └── code.cbp
├── complex.h
├── complex_test.cpp
├── string.h
└── string_test.cpp
├── 课件pdf
├── C++课件_面向对象高级编程.pdf
└── 面向对象Part2.pdf
└── 资源
└── url.txt
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jin-zz/LearningCPlusPlus/e981b43e00669254ac5a6adaaf3d7a35b2f0622f/.DS_Store
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | Primer[[:space:]]C++(第5版).pdf filter=lfs diff=lfs merge=lfs -text
2 | *.pdf filter=lfs diff=lfs merge=lfs -text
3 |
--------------------------------------------------------------------------------
/Code/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/Code/.idea/.name:
--------------------------------------------------------------------------------
1 | Chapter3
--------------------------------------------------------------------------------
/Code/.idea/Chapter3.iml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Code/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Code/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Code/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Code/Chapter3/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/Code/Chapter3/.idea/Chapter3.iml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Code/Chapter3/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Code/Chapter3/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Code/Chapter3/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Code/Chapter3/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.17)
2 | project(Chapter3)
3 |
4 | set(CMAKE_CXX_STANDARD 17)
5 |
6 | add_executable(Chapter3 main.cpp StringConstructor.cpp StringConstructor.h VectorConstructor.cpp VectorConstructor.h TypeConversion.cpp TypeConversion.h iteratorUsing.cpp iteratorUsing.h arrayTest.cpp arrayTest.h)
--------------------------------------------------------------------------------
/Code/Chapter3/StringConstructor.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 金卓群 on 2021/4/26.
3 | // 介绍 string 构造方式
4 | //
5 |
6 | #include "StringConstructor.h"
7 | #include
8 | #include
9 | using namespace std;
10 |
11 | void stringConstructorTest(){
12 | //默认初始化 为空串
13 | string s;
14 | //拷贝初始化 -> 先初始化一个字符串 再赋值给目标对象
15 | string s1 = "xxx";
16 | //拷贝初始化 深拷贝 存入新内存
17 | string s2(s1);
18 | //字面量赋值 直接初始化
19 | string s3("value");
20 | //填充字符串
21 | string s4(10, 'c');
22 | cout<<"s1:"<> s5;
32 | cout << "s5:" < 不会保存输入时的空格
33 | cout << "s5.size():"<< s5.size() << endl;
34 |
35 | cout<< "按行读取字符串:" <
7 | #include
8 | #include
9 | using namespace std;
10 | void typeConversion(){
11 | // string & char[]
12 | cout<> num;
45 | cout<<"string_to_int[use stingstream]:"<> int_to_string;
56 | cout<<"int_to_stiring[use stingstream]:"<
7 | #include
8 | #include
9 | #include
10 |
11 | using namespace std;
12 |
13 | //输出元素
14 | void output(vector& v){
15 | cout<<"输出vector:"< v1;
25 | vector v2(v1); //深拷贝
26 | vector v3 = v1; //深拷贝
27 | vector v4(10, 1); //创建指定数量的元素
28 | vector v5(10);
29 | vector v6{ 1,2,3,4 }; //列表初始化
30 | vector v7 = { 1,2,3,4 };
31 |
32 | //添加元素 push_back
33 | cout<< "---添加元素 push_back(输入一组数字)---"< v;
35 | string str;
36 | getline(cin, str);
37 | int num;
38 | stringstream ss(str);
39 | while(ss>>num){
40 | v.push_back(num);
41 | output(v);
42 | }
43 |
44 | //删除元素 pop_back
45 | cout<< "---删除元素 pop_back---"< 2) ? v[2] : 0;
53 | cout<< "v[2]:"<< a <
6 | #include
7 | #include