qualcuno sa di cosa si tratta?
Mi è capitato in un test informatico per un concorso.......
Salutix
qualcuno sa di cosa si tratta?
Mi è capitato in un test informatico per un concorso.......
Salutix
è una funzione che si usa nel linguaggio c e serve x allocare memoria x una qualche struttura dati
konfermo...
kuando viene dikiarato un puntatore kuesto inizialmente punta al nulla.
mediante la kiamata malloc (memory alloc) lo si inizializza e da kuel momento punta ad una lokazione di memoria fornita dal sistema.
malloc
Allocates memory blocks.
void *malloc( size_t size );
Routine Required Header Compatibility
malloc <stdlib.h> and <malloc.h> ANSI, Win 95, Win NT
For additional compatibility information, see Compatibility in the Introduction.
Libraries
LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version
Return Value
malloc returns a void pointer to the allocated space, or NULL if there is insufficient memory available. To return a pointer to a type other than void, use a type cast on the return value. The storage space pointed to by the return value is guaranteed to be suitably aligned for storage of any type of object. If size is 0, malloc allocates a zero-length item in the heap and returns a valid pointer to that item. Always check the return from malloc, even if the amount of memory requested is small.
Parameter
size
Bytes to allocate
Remarks
The malloc function allocates a memory block of at least size bytes. The block may be larger than size bytes because of space required for alignment and maintenance information.
.
Che bello! Erano anni che non vedevo la malloc... dai tempi dell' ITIS!Originally posted by frenc
konfermo...
kuando viene dikiarato un puntatore kuesto inizialmente punta al nulla.
mediante la kiamata malloc (memory alloc) lo si inizializza e da kuel momento punta ad una lokazione di memoria fornita dal sistema.
malloc
Allocates memory blocks.
void *malloc( size_t size );
Routine Required Header Compatibility
malloc <stdlib.h> and <malloc.h> ANSI, Win 95, Win NT
For additional compatibility information, see Compatibility in the Introduction.
Libraries
LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version
Return Value
malloc returns a void pointer to the allocated space, or NULL if there is insufficient memory available. To return a pointer to a type other than void, use a type cast on the return value. The storage space pointed to by the return value is guaranteed to be suitably aligned for storage of any type of object. If size is 0, malloc allocates a zero-length item in the heap and returns a valid pointer to that item. Always check the return from malloc, even if the amount of memory requested is small.
Parameter
size
Bytes to allocate
Remarks
The malloc function allocates a memory block of at least size bytes. The block may be larger than size bytes because of space required for alignment and maintenance information.
.
![]()
Originally posted by frenc
nada...
e ciao soul.
![]()
Ci sono attualmente 1 utenti che stanno visualizzando questa discussione. (0 utenti e 1 ospiti)