Espaces de noms
Variantes
Actions

std::calloc

De cppreference.com
< cpp‎ | memory‎ | c

 
 
 
La gestion dynamique de la mémoire
Faible niveau de gestion de la mémoire
Répartiteurs
Original:
Allocators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
allocator
allocator_traits (C++11)
allocator_arg_t (C++11)
allocator_arg (C++11)
uses_allocator (C++11)
scoped_allocator_adaptor (C++11)
Non initialisée stockage
Original:
Uninitialized storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uninitialized_copy
uninitialized_copy_n (C++11)
uninitialized_fill
uninitialized_fill_n
raw_storage_iterator
get_temporary_buffer
return_temporary_buffer
Pointeurs intelligents
Original:
Smart pointers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unique_ptr (C++11)
shared_ptr (C++11)
weak_ptr (C++11)
auto_ptr (obsolète)
owner_less (C++11)
enable_shared_from_this (C++11)
bad_weak_ptr (C++11)
default_delete (C++11)
Soutien garbage collection
Original:
Garbage collection support
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declare_reachable (C++11)
undeclare_reachable (C++11)
declare_no_pointers (C++11)
undeclare_no_pointers (C++11)
pointer_safety (C++11)
get_pointer_safety (C++11)
Divers
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pointer_traits (C++11)
addressof (C++11)
align (C++11)
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.
malloc
calloc
 
Déclaré dans l'en-tête <cstdlib>
void* calloc(std::size_t num, std::size_t size );
Alloue de la mémoire pour un tableau d'objets num de size taille et l'initialise à zéro .
Original:
Allocates memory for an array of num objects of size size and zero-initializes it.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si l'allocation réussit, renvoie un pointeur vers le plus bas (premier) octet dans le bloc de mémoire alloué qui est correctement alignée pour n'importe quel type d'objet .
Original:
If allocation succeeds, returns a pointer to the lowest (first) byte in the allocated memory block that is suitably aligned for any object type.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si size est égal à zéro, le comportement est défini par l'implémentation (pointeur NULL peut être retourné, ou quelque pointeur non NULL peuvent être retournés qui ne peut pas être utilisé pour accéder au stockage)
Original:
If size is zero, the behavior is implementation defined (null pointer may be returned, or some non-null pointer may be returned that may not be used to access storage)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier]Paramètres

num -
nombre d'objets
Original:
number of objects
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 objet
Original:
size of each object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier]Retourne la valeur

Pointeur au début de la mémoire nouvellement allouée ou si NULL erreur s'est produite. Le pointeur doit être libérée avec free() .
Original:
Pointer to the beginning of newly allocated memory or NULL if error has occurred. The pointer must be deallocated with free().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier]Notes

En raison des exigences d'alignement, le nombre d'octets alloués n'est pas nécessairement égal à num*size .
Original:
Due to the alignment requirements, the number of allocated bytes is not necessarily equal to num*size.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier]Exemple

[modifier]Voir aussi

C documentation for calloc
close