C++标准库

C++标准库的特点:

        1. 标准库由类库和函数库组成。

        2. 标准库定义的类和对象都位于std命名空间。

        3. 标准库的头文件都不带.h后缀。

        4. 标准库涵盖了C标准库的功能。

C++标准库由:

      C++标准库:C兼容库子模块<cstdio><cstring><cstdlib><cmath>。标准库<queue><deque><stack><vector><map>。

      C语言兼容库:编译器的C库<stdio.h><string.h><stdlib.h><math.h>

      编译器扩展库:编译器扩展的一些类和函数

C++编译模块由:

      C++语法模块:支持C++标准语法

      C++扩展语法模块:编译器扩展的C++语法

包含<iostream> 头文件

使用命名空间 std

cout : 输出对象

cin   : 输入对象

#include <iostream>
using namespace std; int main() { cout << "Hello world!" << endl; double a = 0; double b = 0; cout << "Input a: "; // 标准输出用法 cin >> a; // 标准输入用法 cout << "Input b: "; cin >> b; double c = a + b ; cout << "c = " << c << endl; return 0; }
原文地址:https://www.cnblogs.com/zsy12138/p/10832546.html