C and C++ Manual with Code Examples C und C + +-Handbuch mit Code-Beispiele
C and C++ are two of the most important programming languages today. C und C + + sind zwei der bedeutendsten Programmiersprachen. Many professional programmers are proficient in C and C++. Viele professionelle Programmierer sind geübt in C und C + +. These two programming languages are the foundation upon which modern programming is built. Diese beiden Programmiersprachen sind das Fundament, auf die moderne Programmierung wird gebaut.
The C language was invented by Dennis Ritchie in the 1970s. Die Sprache C wurde von Dennis Ritchie in den 1970er Jahren. 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. Es handelt sich um einen mittleren Ebene Sprache und verbindet die Kontrolle Strukturen eines hochrangigen Sprache mit der Fähigkeit zu manipulieren Bits, Bytes und Zeigern, oder Adressen. C provides a programmer virtually complete control over the computer. C-Programmierer bietet eine nahezu vollständige Kontrolle über den Computer übernehmen.
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 . Diese Web-Site, die C / C + +-Zone, ist nicht als Tutorial, sondern eher als ein C und C + + Programmierung Handbuch mit brauchbaren Code-Beispiele. It is under constant development. Es ist unter ständiger Entwicklung.
C / C++ Zone C / C + + Zone
Algorithms Algorithmen
The generic algorithms fall into four categories, as listed here: Die generischen Algorithmen lassen sich in vier Kategorien, wie hier aufgelistet:
Non-modifying sequence algorithms: Do not modify the containers on which they work. Non-Algorithmen zur Änderung der Reihenfolge: Ändern Sie die Behälter in denen sie arbeiten. Such algorithms include: Diese Algorithmen sind:
adjacent_find, find, find_end, find_first, count, mismatch, equal, for_each, search. adjacent_find, finden, find_end, find_first, Zählen, Missverhältnis, gleicher, for_each, Search.
Mutating sequence algorithms: Modify the containers on which they work. Mutierenden Sequenz Algorithmen: Benutzen Sie den Container in denen sie arbeiten. Such algorithms include: Diese Algorithmen sind:
copy_backward, fill, generate, partition, random_shuffle, remove, replace, rotate, reverse, swap, swap_ranges, transform, unique. copy_backward, füllen, generieren, Partition, random_shuffle, entfernen, ersetzen, drehen, Reverse, Wechselbehälter, swap_ranges, transform, einzigartig.
Sorting algorithms: Sort the contents of containers in various ways. Sortieren Algorithmen: Sortieren Sie den Inhalt von Containern auf verschiedene Weise. These algorithms include: Diese Algorithmen sind:
sort, stable_sort, partial_sort, partial_sort_copy, as well as a number of related functions, including: sortieren, stable_sort, partial_sort, partial_sort_copy, sowie eine Reihe von verwandten Funktionen, unter anderem:
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, zusammenführen, enthält, 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.
Numeric algorithms: Perform numeric calculations on the contents of containers. Numerische Algorithmen: Führen numerische Berechnungen über den Inhalt von Containern. These category includes: Diese Kategorie umfasst:
accumulate, adjacent_difference, inner_product, iota, partial_sum, power. ansammeln, adjacent_difference, inner_product, Jota, partial_sum, Macht.
Iterators Iteratoren
Iterators are pointer-like objects that allow programs to step through the elements of a container sequentially without exposing the underlying representation. Iteratoren sind Zeiger-Objekte, die können auch Programme, um die Elemente eines Containers hintereinander, ohne dass die zugrunde liegenden Repräsentation. Iterators can be advanced from one element to the next by incrementing them. Iteratoren können sich von einem Element zum nächsten springen, indem sie zunehmend. Some iterators can also be decremented or allow arbitrary jumps from one element to another, as we will see later. Einige Iteratoren können auch dekrementiert oder beliebiger springt von einem Element zum anderen, wie wir später sehen werden. When they are dereferenced, iterators yield a reference to a container element. Wenn sie dereferenced, Yield-Iteratoren einen Verweis auf ein Container-Element. In addition, they can be compared to each other for equality or inequality. Darüber hinaus können sie im Vergleich zu jeder anderen für die Gleichheit oder Ungleichheit.
Iterators interact seamlessly with built-in C++ types. Iteratoren interagieren nahtlos mit built-in C + +-Typen. In particular, native C++ pointers are treated as iterators to C++ arrays. Insbesondere native C + + Zeiger behandelt werden als Iteratoren in C + +-Arrays. Naturally, all containers in the Standard C++ Library define an iterator type, ie, a nested type iterator that represent their respective pointer-like type. Natürlich sind alle Behältnisse in der Standard-C + +-Bibliothek definieren einen Iterator Art, dh eine verschachtelte Art Iterator, die ihre jeweiligen Zeiger-Typ.
Iterator Categories Iterators fall into categories. Iterator Kategorien Iteratoren lassen sich in Kategorien. This is because different algorithms impose different requirements on an iterator they use. Dies liegt daran, dass verschiedene Algorithmen auferlegen unterschiedliche Anforderungen an ein Iterator sie nutzen. 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: Zum Beispiel, der find () Algorithmen braucht einen Iterator werden können fortgeschrittene es zunehmend durch, während der umgekehrte ()-Algorithmus braucht eine Iterator werden können, verringert aber auch, usw. Letztendlich gibt es fünf Kategorien von Iteratoren in der STL-und Standard C + + Bibliothek:
- input iterators Input-Iteratoren
- output iterators Output-Iteratoren
- forward iterators nach vorn Iteratoren
- bidirectional iterators bidirektionale Iteratoren
- random access iterators Random Access Iteratoren
An iterator category is an abstraction. Ein Iterator-Klasse ist eine Abstraktion. It represents a set of requirements to an iterator. Es stellt eine Reihe von Anforderungen an ein 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). Die S tandard T emplate L ibrary ist eine neue C + + Bibliothek, die für eine Reihe von leicht zusammensetzbare C + +-Container-Klassen und generische Algorithmen (Template-Funktionen).
The container classes include vectors, lists, deques, sets, multisets, maps, multimaps, stacks, queues and priority queues. Die Container-Klassen sind Vektoren, Listen, deques, Sets, multisets, Landkarten, multimaps, Stacks, Queues und Priority-Queues.
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. Die generischen Algorithmen umfassen eine breite Palette von grundlegenden Algorithmen für die gängigsten Arten von Daten-Manipulationen, wie Suchen, Sortieren, Zusammenführen, Kopieren und Transformation.
At its July 1994 meeting, the ANSI/ISO C++ Standards Committee voted to adopt STL as part of the standard C++ library. Auf seiner Sitzung Juli 1994, der ANSI / ISO C + + Standards Committee stimmte zu verabschieden STL als Teil der Standard C + + Bibliothek. 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++. Die STL-Vorschlag an den Ausschuss von Alex Stepanov und Meng Lee von Hewlett-Packard Labs stützte sich auf die Forschung in generischen Programmierung und generisches Software-Bibliotheken, Stepanow, Lee, und David Musser gearbeitet haben über mehrere Jahre, in Scheme, Ada, und C + +.
String String
C++ supports characters strings two ways. C + + unterstützt die Zeichen Zeichenketten zwei Möglichkeiten. The first is as a null-terminated character array. Die erste ist als null-terminated Array Charakter. This is sometimes referred to as a C string. Dies ist manchmal auch als C-String. The second way is as a class object of type basic_string. Der zweite Weg ist eine Klasse als Objekt vom Typ basic_string. The basic_string class is essentially a container. Die basic_string Klasse ist im Wesentlichen ein Container. this means that iterators and the STL algorithms can operate on string. bedeutet dies, dass Iteratoren und die STL-Algorithmen können auf String. However, string has additional capabilities. Allerdings, string hat zusätzliche Fähigkeiten.
C++ string recognizes operators: <, <=, >, >=, ==, !=, =, += . C + +-String erkennt Operatoren: <, <=,>,> =, ==,! =, =, + =.
When you use template functions, or classes you don't need to write addition function with strcpy, ctrcmp of ctrcat... Wenn Sie Template Funktionen, Klassen oder die Sie nicht schreiben müssen zusätzlich mit der Funktion strcpy, ctrcmp von ctrcat ... In this case C++ string works like any of built-in data type. In diesem Fall C + +-String funktioniert wie jeder von Einbau-Datentyp.
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. String-Funktionen. C + +-String, wie jeder von Container-Klassen, hat seine eigene öffentliche Aufgaben zuständig sind, hinzuzufügen, dass eine Menge Flexibilität für die Manipulation von C + +-String-Datentyp.
Overflowing. Überfüllt.
You don't need to think about overflowing or null-terminating character. Sie brauchen nicht zu denken überfüllt oder Null-Einstellung Charakter. C++ string allows use sequence of characters as long as allows ability of your OS. C + +-String ermöglicht den Einsatz Folge von Zeichen, solange erlaubt Fähigkeit Ihres Betriebssystems.
More C Programming Examples and Help Mehr C-Programmierung Beispiele und Hilfe
Stdio Functions Stdio-Funktionen
- fclearerr - fread fclearerr - fread
- freopen - puts freopen - puts
- remove - ungetc entfernen - ungetc
String Functions String-Funktionen
- memory functions Speicher-Funktionen
- string functions String-Funktionen
- ctype functions ctype Funktionen
Time Functions Zeit-Funktionen
Technorati Tags: Technorati Tags: c programming C-Programmierung , c code C-Code , c examples C Beispiele , c manual c-Handbuch , c++ c + + , c++ programming C + + Programmierung , c++ code C + +-Code , c++ examples c + + Beispiele , c++ manual c + + Handbuch
Popularity: 38% [ Beliebtheit: 38% [ ? ? ] ]
Related Posts: Verwandte Beiträge:





















