Breymann. C++ Einführung und professionelle Programmierung
Breymann. C++ Einführung und professionelle Programmierung Breymann. C++ Einführung und professionelle Programmierung
Vorhandene Algorithmen: for_each find find_if find_end find_first_of adjacent_find count mismatch equal search search_n copy copy_backward copy_if swap iter_swap swap_ranges transform replace fill fill_n generate generate_n remove unique reverse rotate random_shuffle partition sort partial_sort nth_element binary_search lower_bound upper_bound equal_range includes set_union set_intersecti set_difference set_symmetric_difference pop_heap push_heap make_heap sort_heap min max min_element max_element lexicographical_compare next_permutati prev_permutation accumulate inner_product partial_sum adjacent_difference Breymann C++, c○ Hanser Verlag München Inhalt ◭◭ ◭ ◮ ◮◮ 430 zurück Ende
11.1.3 Beispiel Variante 1: noch ohne Benutzung der STL #include typedef int* Iterator;// neuer Typname using std::cout; using std::endl; // Prototyp des Algorithmus Iterator find(Iterator Anfang, Iterator Ende, const int& Wert); int main() { const int Anzahl = 100; int einContainer[Anzahl]; // Container definieren Iterator begin = einContainer; // Anfang Iterator end = einContainer + Anzahl; // Ende+1 for(int i = 0; i < Anzahl; ++i) // Container füllen einContainer[i] = 2*i; Breymann C++, c○ Hanser Verlag München Inhalt ◭◭ ◭ ◮ ◮◮ 431 zurück Ende
- Seite 380 und 381: ✬ ✩ Vektor-Objekt start xDim (=
- Seite 382 und 383: Zuweisungsoperator Vektor& operator
- Seite 384 und 385: template inline void Vektor::init(c
- Seite 386 und 387: Zuweisung von Vektorelementen per W
- Seite 388 und 389: Möglicher Einsatz: Vektor v(5); //
- Seite 390 und 391: template inline Vektor &Vektor::ope
- Seite 392 und 393: 9.2.3 Mathematische Vektoren Vektor
- Seite 394 und 395: 9.2.4 Multiplikations-Operator Anwe
- Seite 396 und 397: * Operator für den Fall v1 = zahl*
- Seite 398 und 399: Um bereits vor der Konstruktion ein
- Seite 400 und 401: void Datum::aktuell() { // Systemda
- Seite 402 und 403: Der Postfix-Inkrementierungsoperato
- Seite 404 und 405: datum.h #include class Datum { // .
- Seite 406 und 407: Es ist sowohl die implizite als auc
- Seite 408 und 409: 3. errno setzen 4. Fehlerbehandlung
- Seite 410 und 411: Wege zur Fehlerbehandlung: • Den
- Seite 412 und 413: gegebenenfalls weitere catch-Blöck
- Seite 414 und 415: 10.1.2 Exception-Hierarchie in C++
- Seite 416 und 417: Breymann C++, c○ Hanser Verlag M
- Seite 418 und 419: Große Teile des Konzepts sind durc
- Seite 420 und 421: 11.1 Die C++ Standardbibliothek, ge
- Seite 422 und 423: 11.1.1 Abstrakte und implizite Date
- Seite 424 und 425: 11.1.2 Bauelemente Container Klasse
- Seite 426 und 427: Allen Containern gemeinsam sind auc
- Seite 428 und 429: Iteratoren = Objekte, die auf Eleme
- Seite 432 und 433: } int Zahl = 0; do { cout > Zahl; I
- Seite 434 und 435: Variante 2: Prototyp durch Template
- Seite 436 und 437: } do { cout > Zahl; // Benutzung vo
- Seite 438 und 439: 11.2 Iteratoren im Detail Iteratore
- Seite 440 und 441: 11.2.1 Iteratorkategorien → sind
- Seite 442 und 443: • Random-Access-Iterator wie Bidi
- Seite 444 und 445: Ja. Schwachstelle: • Die Algorith
- Seite 446 und 447: Wie funktioniert dies im einzelnen?
- Seite 448 und 449: 11.2.3 Markierungen und Identifizie
- Seite 450 und 451: 11.3 Zusammenfassung der STL-Eigens
Vorhandene Algorithmen:<br />
for_each find find_if<br />
find_end find_first_of adjacent_find<br />
count mismatch equal<br />
search search_n copy<br />
copy_backward copy_if swap<br />
iter_swap swap_ranges transform<br />
replace fill fill_n<br />
generate generate_n remove<br />
unique reverse rotate<br />
random_shuffle partition sort<br />
partial_sort nth_element binary_search<br />
lower_bo<strong>und</strong> upper_bo<strong>und</strong> equal_range<br />
includes set_union set_intersecti<br />
set_difference set_symmetric_difference pop_heap<br />
push_heap make_heap sort_heap<br />
min max min_element<br />
max_element lexicographical_compare next_permutati<br />
prev_permutation accumulate inner_product<br />
partial_sum adjacent_difference<br />
<strong>Breymann</strong> <strong>C++</strong>, c○ Hanser Verlag München<br />
Inhalt ◭◭ ◭ ◮ ◮◮ 430 zurück Ende