Espaces de noms
Variantes

« cpp/algorithm/qsort » : différence entre les versions

De cppreference.com
P12bot (discussion | contributions)
m r2.7.3) (robot Ajoute : de, en, es, it, pt, ru Retire : fr
P12bot (discussion | contributions)
m Use {{lc}}. Update links. Various fixes.
 
Ligne 2 : Ligne 2 :
{{cpp/title|qsort}}
{{cpp/title|qsort}}
{{cpp/algorithm/navbar}}
{{cpp/algorithm/navbar}}
{{ddcl list begin}}
{{begin}}
{{ddcl list header | cstdlib}}
{{header | cstdlib}}
{{ddcl list item |
{{|
void qsort( const void *ptr, size_t count, size_t size,
void qsort( const void *ptr, size_t count, size_t size,
             int (*comp)(const void *, const void *) );
             int (*comp)(const void *, const void *) );
}}
}}
{{ddcl list end}}
{{end}}


{{tr|Trie le tableau donné pointé par {{tt|ptr}} dans l'ordre croissant. Le tableau contient des éléments {{tt|count}} de {{tt|size}} taille. Fonction pointée par {{tt|comp}} est utilisé pour la comparaison d'objets .|Sorts the given array pointed to by {{tt|ptr}} in ascending order. The array contains {{tt|count}} elements of size {{tt|size}}. Function pointed to by {{tt|comp}} is used for object comparison.}}
{{tr|Trie le tableau donné pointé par {{tt|ptr}} dans l'ordre croissant. Le tableau contient des éléments {{tt|count}} de {{tt|size}} taille. Fonction pointée par {{tt|comp}} est utilisé pour la comparaison d'objets .|Sorts the given array pointed to by {{tt|ptr}} in ascending order. The array contains {{tt|count}} elements of size {{tt|size}}. Function pointed to by {{tt|comp}} is used for object comparison.}}


===Paramètres===
===Paramètres===
{{param list begin}}
{{begin}}
{{param list item | ptr |{{tr| pointeur vers le tableau à trier| pointer to the array to sort}}}}
{{| ptr |{{tr| pointeur vers le tableau à trier| pointer to the array to sort}}}}
{{param list item | count |{{tr| nombre d'éléments dans le tableau| number of element in the array}}}}
{{| count |{{tr| nombre d'éléments dans le tableau| number of element in the array}}}}
{{param list item | size |{{tr| taille de chaque élément dans le tableau en octets| size of each element in the array in bytes}}}}
{{| size |{{tr| taille de chaque élément dans le tableau en octets| size of each element in the array in bytes}}}}
{{param list ccmp | comp }}
{{ccmp | comp }}
{{param list end}}
{{end}}


===Retourne la valeur===
===Retourne la valeur===
Ligne 60 : Ligne 60 :


===Voir aussi===
===Voir aussi===
{{dcl list begin}}
{{begin}}
{{dcl list template | cpp/algorithm/dcl list bsearch}}
{{| cpp/algorithm/bsearch}}
{{dcl list template | cpp/algorithm/dcl list sort}}
{{| cpp/algorithm/sort}}
{{dcl list template | cpp/types/dcl list is_trivial}}
{{| cpp/types/is_trivial}}
{{dcl list see c | c/algorithm/qsort}}
{{see c | c/algorithm/qsort}}
{{dcl list end}}
{{end}}


[[de:cpp/algorithm/qsort]]
[[de:cpp/algorithm/qsort]]

Dernière version du 2 juillet 2013 à 11:27

<metanoindex/>

 
 
Bibliothèque d'algorithmes
Fonctions
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Non-modification de la séquence des opérations
Original:
Non-modifying sequence operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Modification de la séquence des opérations
Original:
Modifying sequence operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Des opérations de partitionnement
Original:
Partitioning operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Opérations de tri (sur les gammes triés)
Original:
Sorting operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_sorted (C++11)
is_sorted_until (C++11)
sort
Opérations binaires de recherche (sur les gammes triés)
Original:
Binary search operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Définir les opérations (sur les gammes triés)
Original:
Set operations (on sorted ranges)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Opérations Heap
Original:
Heap operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Minimum / maximum de fonctionnement
Original:
Minimum/maximum operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Opérations numériques
Original:
Numeric operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Bibliothèque C
Original:
C library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
<tbody> </tbody>
Déclaré dans l'en-tête <cstdlib>
void qsort( const void *ptr, size_t count, size_t size, int (*comp)(const void *, const void *) );
Trie le tableau donné pointé par ptr dans l'ordre croissant. Le tableau contient des éléments count de size taille. Fonction pointée par comp est utilisé pour la comparaison d'objets .
Original:
Sorts the given array pointed to by ptr in ascending order. The array contains count elements of size size. Function pointed to by comp is used for object comparison.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Paramètres

ptr -
pointeur vers le tableau à trier
Original:
pointer to the array to sort
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
count -
nombre d'éléments dans le tableau
Original:
number of element in the array
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
size -
taille de chaque élément dans le tableau en octets
Original:
size of each element in the array in bytes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
comp - comparison function which returns ​a negative integer value if the first argument is less than the second,

a positive integer value if the first argument is greater than the second and zero if the arguments are equal.
The signature of the comparison function should be equivalent to the following:

int cmp(const void *a, const void *b);

The function must not modify the objects passed to it.

Retourne la valeur

(Aucun)
Original:
(none)
The text has been machine-translated via