malloc
Aus 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. |
definiert in Header <stdlib.h>
|
||
void* malloc( size_t size ); |
||
Reserviert einen Speicherbereich der Größe
size
Bytes.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.
Wenn die Zuweisung erfolgreich durchgeführt ist, wird ein Zeiger auf die Adresse des niedrigsten (ersten), nutzbaren Bytes zurück gegeben.
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.
Wenn
size
Null ist, ist das Verhalten Implementierung definiert (NULL-Zeiger zurückgegeben werden, oder einige Nicht-NULL-Zeiger zurückgegeben, dass möglicherweise nicht verwendet werden, um Speicher zugreifen werden)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.
[Bearbeiten] Parameter
size | - | Anzahl von Bytes, zuzuweisen
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. |
[Bearbeiten] Rückgabewert
Zeiger auf den Anfang der neu zugewiesenen Speicher oder Null-Zeiger, wenn der Fehler aufgetreten ist. Der Zeiger muss mit
free()
freigegeben werden .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.
[Bearbeiten] Siehe auch
C++ documentation for malloc
|