Biblioteka jzyka C Biblioteka jzyka C Biblioteka jzyka
Biblioteka języka C++
Biblioteka języka C++ • Biblioteka języka C++ zawiera: – Bibliotekę języka C (C Library) • ”importowana” z języka C – Standardową bibliotekę C++ (C++ Standard Library) • intensywnie wykorzystuje techniki OOP i generyczne • ciągle rozbudowywana w odpowiedzi na potrzeby użytkowników C++
Bibliografia na temat biblioteki – Nicolai M. Josuttis: C++ Standard Library: A tutorial and Reference, 1 st, Pearson 1999, przykłady: http: //www. josuttis. com/libbook/examples. zip • (PL: Nicolai M. Josuttis: C++ Biblioteka standardowa Podręcznik Programisty, Helion 2003, examples: ftp: //ftp. helion. pl/przyklady/cpbspp. zip) • Nicolai M. Josuttis: C++ Standard Library: A tutorial and Reference, 2 nd, Addison Wesley Longman 2012, (rozszerzona, uwzględnia m. in. standard C++11) – Grębosz J. : Pasja C++, RM, W-wa – The C++ Resources Network: http: //www. cplus. com/ (Obejmuje język C++ i jego biblioteki) – Inne (patrz pierwszy wykład, w tym standard języka C++)
Biblioteka języka C • Biblioteka języka C – zapewnia kompatybilność ze starym kodem … – jak również ze starymi nawykami programistów (printf()) … – jak również sprawdzone elementy których nie było potrzeby modyfikować (assert()) – konwencja: nazwy nagłówków z C z dodanym ‘c’ (n. p. <cassert> dla C <assert. h>, <cstdio> dla <stdio. h>) • Nagłówki biblioteki języka C (za „The C++ Resources Network”) – – cassert (assert. h z jęzka C) cctype (ctype. h) cerrno (errno. h) cfloat (float. h) C Diagnostics Library Character handling functions C Errors Characteristics of floating-point types
Biblioteka języka C • Nagłówki biblioteki języka C (c. d. ) – – – ciso 646 (iso 646. h) climits (limits. h) clocale (locale. h) cmath (math. h) csetjmp (setjmp. h) csignal (signal. h) cstdarg (stdarg. h) cstddef (stddef. h) cstdio (stdio. h) cstdlib (stdlib. h) cstring (string. h) ctime ISO 646 Alternative operator spellings Sizes of integral types C localization library C numerics library Non local jumps C library to handle signals Variable arguments handling C Standard definitions C library to perform I/O operations C Standard General Utilities Library C Strings C Time Library
Biblioteka języka C++ • Biblioteka języka C • Biblioteka standardowa C++ – – STL (patrz: wykład o STL) Klasy strumieniowe (patrz: wykład o bibliotece I/O) Klasy łańcuchowe (string) (patrz: wykład o klasach łańcuchowych) Miscelaneous – rozmaite dodatkowe elementy, formalnie <string> jest jednym z nich – Biblioteka zdefiniowana w przestrzeni nazw std: : – Znacząco rozbudowana od standardu C++11 (głównie część STL)
Biblioteka standardowa C++ • Nagłówki Biblioteka standardowej C++ (klasyfikacja za ”The C++ Resources Network”) • Miscellaneous – Language support library: • • limits new typeinfo exception – Diagnostics library: • stdexcept Numeric limits Dynamic memory Type information Standard exception class (class) Exception classes
Biblioteka standardowa C++ • Miscellaneous (c. d. ) – General utilities library: • utility Utility components – functional Function objects • memory – Strings library: • string Memory elements C++ Strings library (library ) (patrz wykład o klasach łańcuchowych) – Localization library: • locale Localization library
Biblioteka standardowa C++ • Standard Template Library (STL) – Containers library: • • • bitset Bitset (class template) deque Double ended queue (class template ) list List (class template ) map Map (class template ) multimap Multiple-key map (class template ) multiset Multiple-key set (class template) priority_queue Priority queue (class template ) queue FIFO queue (class template ) set Set (class template ) stack LIFO stack (class template ) vector Vector (class template )
Biblioteka standardowa C++ • Standard Template Library (c. d. ) – Iterators library: • iterator – Algorithms library: • algorithm – Numeric library: • complex • valarray • numeric Iterator definitions Standard Template Library: Algorithms (library) Complex numbers library Library for arrays of numeric values Generalized numeric operations • Input/Output Stream Library (patrz wykład o bibliotece I/O)
- Slides: 10