kennen:lib:lexicographical_compare
no way to compare when less than two revisions
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
— | kennen:lib:lexicographical_compare [2020-06-15 14:18] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== lexicographical_compare() ====== | ||
+ | ''# | ||
+ | |||
+ | <code cpp> | ||
+ | bool lexicographical_compare (In first, In last, In2 first2, In2 last2) | ||
+ | bool lexicographical_compare (In first, In last, In2 first2, In2 last2, Binary comp) | ||
+ | bool lexicographical_compare (Exec pol, In first, In last, In2 first2, In2 last2) | ||
+ | bool lexicographical_compare (Exec pol, In first, In last, In2 first2, In2 last2, Binary comp) | ||
+ | |||
+ | bool ranges:: | ||
+ | bool ranges:: | ||
+ | </ | ||
+ | Ist wahr, wenn der Bereich [first, | ||
+ | |||
+ | ==== Parameter ==== | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | ==== Ergebnis ==== | ||
+ | Rückgabewert: | ||
+ | * der erste Bereich kürzer ist als der zweite oder | ||
+ | * beim ersten Unterschied das Element des ersten Bereiches kleiner ist | ||
+ | als das entsprechende Element des zweiten Bereiches. | ||
+ | Andernfalls ist das Ergebnis '' | ||
+ | insbesondere auch bei übereinstimmenden Folgen gleicher Länge. | ||
+ | |||
+ | ==== Siehe auch ==== | ||
+ | - | ||
+ | |||
+ | ==== Beispiel ==== | ||
+ | <code cpp lexicographical_compare.cpp> | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | std::string s, t; | ||
+ | std::cout << "Gib zwei Worte ein: "; | ||
+ | std::cin >> s >> t; | ||
+ | |||
+ | if (std:: | ||
+ | { | ||
+ | std::cout << s << "steht vor " << t << " im Lexikon.\n"; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | std::cout << s << "steht nicht vor " << t << " im Lexikon.\n"; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
kennen/lib/lexicographical_compare.txt · Zuletzt geändert: 2020-06-15 14:18 von 127.0.0.1