C++標準庫教學

C++是由Bjarne Stroustrup於1979年在貝爾實驗室開發的中級程序設計語言。 C++在各種平臺上運行,例如Windows,Mac OS和各種版本的 UNIX/Linux。

C++標準庫是以C++語言爲核心編寫的類,函數,宏,常量等的集合。一個頭文件可以根據不同的編譯器實現而變化。此教程中包含C++標準庫中的內容,新的C++特定頭文件以及C++標準模板庫(STL)的其他重要的頭文件。

面向讀者

C++標準庫是C++程序員的參考,幫助他們在項目開發過程與系統編程相關編程時參考應用。 本教程中所有的C++函數都是以一種易於理解的方式或示例來演示說明,這此示例可以很容易地在開發的C++項目中使用。

閱讀或使用教程的前提條件

有C++編程語言的基本理解和知識,有助理解此庫中包含的C++類和內置函數。所以要求讀者最好有C語言或C++編程基礎知識。

代碼開發或測試環境

查看在Linux系統上安裝的C++編譯器,如下命令 -

[root@yiibai ~]# g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)

對於本教程中給出的大多數示例,您可以加以運行和測試,因此您要還需要安裝好C++的編譯環境。還要熟悉C++的編譯的鏈接,並執行輸出結果。