[ Web Proxy ]
URL:
Viewing: https://fr.cppreference.com/cpp/memory/c/malloc [Back]  [Original]

std::malloc cppreference.com
cppreference.com
Espaces de noms
Variantes

std::malloc

De cppreference.com
< cpp | memory | c

<metanoindex/>

 
 
 
La gestion dynamique de la mmoire
Faible niveau de gestion de la mmoire
Rpartiteurs
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 initialise 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 (obsolte)
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)
Bibliothque 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>
Dclar dans l'en-tte <cstdlib>
void* malloc( std::size_t size );
Alloue size octets de stockage non initialise .
Original:
Allocates size bytes of uninitialized storage.
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 russit, renvoie un pointeur vers le plus bas (premier) octet dans le bloc de mmoire allou qui est correctement aligne 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 zro, le comportement est dfini par l'implmentation (pointeur NULL peut tre retourn, ou quelque pointeur non NULL peuvent tre retourns qui ne peut pas tre utilis pour accder 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.

Paramtres

size -
nombre d'octets allouer
Original:
number of bytes to allocate
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Retourne la valeur

Pointeur au dbut de la mmoire nouvellement alloue ou pointeur null si erreur s'est produite. Le pointeur doit tre libre avec free() .
Original:
Pointer to the beginning of newly allocated memory or null pointer 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.

Notes

Cette fonction n'est pas appeler des constructeurs ou initialiser la mmoire d'aucune faon. Ainsi mthode prfre de l'allocation de mmoire est l'expression new .
Original:
This function does not call constructors or initialize memory in any way. Thus preferred method of memory allocation is new expression.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Exemple

Voir aussi

fonctions d'allocation
Original:
allocation functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
obtient de stockage non initialise
Original:
obtains uninitialized storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]
C documentation for malloc

Web Proxy Viewer  |  New URL  |  Original Page