C and C++ Manual with Code Examples CおよびC + +マニュアルでコードの例
C and C++ are two of the most important programming languages today. CおよびC + +には2つのプログラミング言語で最も重要な日です。 Many professional programmers are proficient in C and C++.多くのプロのプログラマーは、熟練のCおよびC + +です。 These two programming languages are the foundation upon which modern programming is built.これらの2つのプログラミング言語は、現代のプログラミングの基盤の上に構築します。
The C language was invented by Dennis Ritchie in the 1970s. C言語はデニスリッチーは、 1970年代に発明されています。 It is a middle-level language and combines the control structures of a high-level language with the ability to manipulate bits, bytes, and pointers, or addresses.それは、中間レベルの言語と組み合わせた制御構造は、高レベルの言語能力を操作するとビット、バイト、およびポインタか、またはアドレスを入力します。 C provides a programmer virtually complete control over the computer. cでは、事実上完全に制御することは、コンピュータプログラマです。
This web site, the C / C++ Zone, is not designed as a tutorial, but rather as a C and C++ programming manual with usable code examples .このWebサイトのC / C + +のゾーンではないとして設計さチュートリアルではなく、むしろ、 CおよびC + +プログラミングマニュアルで使用可能なコードの例を紹介します。 It is under constant development.これは定数開発されています。
C / C++ Zone 用C / C + +ゾーン
Algorithms アルゴリズム
The generic algorithms fall into four categories, as listed here: 4つのカテゴリに陥るの汎用的なアルゴリズムを、ここに記載さ:
Non-modifying sequence algorithms: Do not modify the containers on which they work. シーケンスを変更する以外のアルゴリズム:コンテナ上では変更しない彼らの仕事です。 Such algorithms include:このようなアルゴリズムを含める:
adjacent_find, find, find_end, find_first, count, mismatch, equal, for_each, search. adjacent_find 、検索、 find_end 、 find_first 、数、不整合、平等、 for_each 、検索します。
Mutating sequence algorithms: Modify the containers on which they work. 変異シーケンスアルゴリズム:コンテナ上で変更して働いています。 Such algorithms include:このようなアルゴリズムを含める:
copy_backward, fill, generate, partition, random_shuffle, remove, replace, rotate, reverse, swap, swap_ranges, transform, unique. copy_backward 、塗りつぶし、生成、パーティション、 random_shuffle 、削除、置換、回転、逆引き、スワップ、 swap_ranges 、変換、ユニークです。
Sorting algorithms: Sort the contents of containers in various ways. 並べ替えのアルゴリズム:コンテナの内容を並べ替えるには様々な方法があります。 These algorithms include:これらのアルゴリズムを含める:
sort, stable_sort, partial_sort, partial_sort_copy, as well as a number of related functions, including:並べ替え、 stable_sort 、 partial_sort 、 partial_sort_copy 、関連しただけでなく、いくつかの機能を含む:
nth_element, binary_search, lower_bound, upper_bound, equal_range, merge, includes, push_heap, pop_heap, make_heap, sort_heap, set_union, set_intersection, set_difference, set_symmetric_difference, min, min_element, max, max_element, lexicographical_compare, next_permutation, prev_permutation. nth_element 、 binary_search 、 lower_bound 、 upper_bound 、 equal_range 、マージ、含まれて、 push_heap 、 pop_heap 、 make_heap 、 sort_heap 、 set_union 、 set_intersection 、 set_difference 、 set_symmetric_difference 、分、 min_element 、最大、 max_element 、 lexicographical_compare 、 next_permutation 、 prev_permutationです。
Numeric algorithms: Perform numeric calculations on the contents of containers. 数値的アルゴリズム:数値計算を実行するコンテナの内容です。 These category includes:これらのカテゴリが含まれます:
accumulate, adjacent_difference, inner_product, iota, partial_sum, power.蓄積、 adjacent_difference 、 inner_product 、イオタ、 partial_sum 、パワーです。
Iterators イテレータ
Iterators are pointer-like objects that allow programs to step through the elements of a container sequentially without exposing the underlying representation.イテレータはポインタのようなオブジェクトができるようにプログラムを使用して、コンテナの要素を順番に露出の根底に表現します。 Iterators can be advanced from one element to the next by incrementing them.反復子は、次の高度から1つの要素をインクリメントされています。 Some iterators can also be decremented or allow arbitrary jumps from one element to another, as we will see later.いくつかのイテレータまたは減少することも可能により、任意のジャンプを別の1つの要素から、我々は参照してください。 When they are dereferenced, iterators yield a reference to a container element.逆参照場合には、反復子収率を参照してコンテナ要素を作成します。 In addition, they can be compared to each other for equality or inequality.加えて、お互いのかを比較することができます下の平等や不平等です。
Iterators interact seamlessly with built-in C++ types.反復子相互作用とシームレスに内蔵されてC + +の種類です。 In particular, native C++ pointers are treated as iterators to C++ arrays.特に、ネイティブのC + +のポインタとして扱われることはiteratorsをC + +の配列です。 Naturally, all containers in the Standard C++ Library define an iterator type, ie, a nested type iterator that represent their respective pointer-like type.当然のことながら、すべてのコンテナには、標準C + +ライブラリを定義するための反復子のタイプ、すなわち、ネストされたタイプイテレータを表す、それぞれのポインタのようなタイプです。
Iterator Categories Iterators fall into categories. カテゴリー別カテゴリーイテレータイテレータに陥る。 This is because different algorithms impose different requirements on an iterator they use.これは、さまざまな要件を課す上で異なるアルゴリズムイテレータを使用します。 For example, the find() algorithms needs an iterator that can be advanced by incrementing it, whereas the reverse() algorithm needs an iterator that can be decremented as well, etc. Ultimately, there are five categories of iterators in STL and Standard C++ Library:たとえば、 find ( )のアルゴリズムが必要な場合にイテレータを増加させることができる高度なことが、その逆( )のアルゴリズムが必要な場合にイテレータも減少することができるなど、最終的には5つのカテゴリのイテレータは、標準C + +のSTLライブラリ:
- input iterators入力イテレータ
- output iterators出力イテレータ
- forward iterators進むイテレータ
- bidirectional iterators双方向イテレータ
- random access iteratorsランダムアクセス反復子
An iterator category is an abstraction.カテゴリは、抽象化するための反復子です。 It represents a set of requirements to an iterator.それを表すの要件をセットするための反復子です。
STL STLの
The S tandard T emplate L ibrary is a new C++ library that provides a set of easily composable C++ container classes and generic algorithms (template functions). emplate 左のS tandard トン ibraryは、新しいC + +ライブラリを簡単にセットの組み合わせを提供するC + +のコンテナクラスと汎用的なアルゴリズム(テンプレート機能) 。
The container classes include vectors, lists, deques, sets, multisets, maps, multimaps, stacks, queues and priority queues. コンテナクラスは、ベクトル、リスト、 deques 、セット、 multisets 、地図、 multimaps 、スタック、キューと優先度キューです。
The generic algorithms include a broad range of fundamental algorithms for the most common kinds of data manipulations, such as searching, sorting, merging, copying, and transforming.の汎用的なアルゴリズムには、広範な共通の基本的なアルゴリズムは、ほとんどの種類のデータを操作など、検索、並べ替え、マージ、コピー、および変換します。
At its July 1994 meeting, the ANSI/ISO C++ Standards Committee voted to adopt STL as part of the standard C++ library. 1994年7月にその会議ではANSI / ISOのC + +のSTLを採用する規格委員会投票の一環として、標準C + +ライブラリです。 The STL proposal to the committee by Alex Stepanov and Meng Lee of Hewlett-Packard Labs was based on research on generic programming and generic software libraries that Stepanov, Lee, and David Musser have been working on for several years, in Scheme, Ada, and C++. STLの提案をされ、同委員会の李孟アレックスステパノフとヒューレットパッカードに基づいて研究をラボは、汎用的なプログラミングと汎用的なソフトウェアライブラリのステパーノフ、李、およびデビッドmusserに取り組んでも数年間は、スキーム、エイダ、およびC + +のです。
String 文字列
C++ supports characters strings two ways. C + +をサポートする文字の文字列を2つの方法です。 The first is as a null-terminated character array.としての最初のは、ヌル終端文字配列です。 This is sometimes referred to as a C string.これは、 C文字列とも呼ばれます。 The second way is as a class object of type basic_string. 2番目の方法はクラスオブジェクトの種類としてbasic_stringです。 The basic_string class is essentially a container. basic_stringクラスは、本質的には、コンテナを作成します。 this means that iterators and the STL algorithms can operate on string.これは、反復子とSTLのアルゴリズムの文字列を操作することです。 However, string has additional capabilities.しかし、文字列には、追加機能を提供します。
C++ string recognizes operators: <, <=, >, >=, ==, !=, =, += . C + +の文字列を認識演算子: < 、 < = 、 > 、 > = 、 == 、 ! = 、 = 、 + =です。
When you use template functions, or classes you don't need to write addition function with strcpy, ctrcmp of ctrcat...テンプレート機能を使用する場合、またはクラスを書く必要はありません関数strcpyを加え、 ctrcmpのctrcat ... In this case C++ string works like any of built-in data type.この場合、 C + +の文字列のいずれかの作品のようなビルトインのデータ型を表します。
String functions .C++ string, like any of container classes, has its own public functions, that add a lot of flexibility for manipulation of C++ string data type. 文字列関数です。 C + +の文字列を、任意のコンテナのようなクラスには独自の公共機能は、たくさんのことを追加する操作の柔軟性をC + +の文字列データ型です。
Overflowing. あふれています。
You don't need to think about overflowing or null-terminating character.を考える必要はありません。あふれている場合にはnull終端文字です。 C++ string allows use sequence of characters as long as allows ability of your OS. C + +の文字列を文字列により、使用する限り、できる能力をお使いのOSです。
More C Programming Examples and Help 他のCプログラミングの例やヘルプ
Stdio Functions標準入出力機能
String Functions文字列関数
Time Functions時刻関数
Technorati Tags: Technoratiのタグ: c programming Cプログラミング , 、 c code Cコード , 、 c examples cの例 , 、 c manual cマニュアル , 、 c++ C + +で , 、 c++ programming C + +プログラミング , 、 c++ code C + +コード , 、 c++ examples C + +の例 , 、 c++ manual C + +のマニュアル
Popularity: 38% [人気度: 38 % [ ? ですか? ] ]
Related Posts: 関連記事:





















