对于C++,你了解多少呢?在学习C++的漫漫长路上,基本结构可是必须掌握的东西。这一章,我就带大家聊聊“基本结构”。
目录
Ⅰ、process exited with return value 3221225477
Ⅱ、process exited with return value 3221225725
Ⅲ、process exited with return value 3221225620
1、头文件
C++常用的头文件包括:
-
iostream
:用于输入输出操作的头文件,包括cin
、cout
、endl
等。 -
iomanip
:用于格式化输出操作的头文件,包括setw
、setprecision
等。 -
cmath
:用于数学运算操作的头文件,包括数学函数如sqrt
、sin
、cos
等。 -
cstdlib
:用于系统调用、随机数生成等操作的头文件,包括rand
、atoi
、exit
等。 -
cstring
:用于字符串操作的头文件,包括strlen
、strcpy
、strcat
等。 -
vector
:用于向量操作的头文件,包括vector
、push_back
、pop_back
等。 -
algorithm
:用于算法操作的头文件,包括sort
、reverse
、find
等。 -
string
:用于字符串处理的头文件,包括string
、substr
、find
等。 -
fstream
:用于文件输入输出操作的头文件,包括fstream
、ifstream
、ofstream
等。 -
ctime
:用于时间处理的头文件,包括time
、clock
等。
这些头文件,只是C++头文件的一小部分。更多的头文件,会在今后的学习中学到。
那有的同学就问了,那么多头文件,该怎么记忆呢?
其实没有关系,c++头文件中还有一个大BOSS:
#include<bits/stdc++.h>
这个头文件可厉害了,他有着几乎所有C++的头文件:
Tips:以下为stdc++.h的内容,可跳过
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cuchar>
#endif
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>