std::malloc
De cppreference.com
[] |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<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.
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.
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.
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.
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.
You can help to correct and verify the translation. Click here for instructions.
Exemple
| This section is incomplete Reason: no example |
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) | |
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) | |
C documentation for malloc
| |