Espacios de nombres
Variantes
Acciones

std::calloc

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

 
 
Utilidades de la biblioteca
Escriba apoyo (basic types, RTTI, type traits)
Gestión de memoria dinámica
Gestión de errores
Programa de servicios públicos
Funciones variadic
Fecha y hora
Objetos Function
initializer_list(C++11)
bitset
hash(C++11)
Operadores relacionales
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares y tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Cambiar, hacia adelante y mover
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
Gestión de memoria dinámica
Bajo la gestión de memoria de nivel
Los asignadores
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)
Inicializar el almacenamiento
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
Punteros inteligentes
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(obsoleto)
owner_less(C++11)
enable_shared_from_this(C++11)
bad_weak_ptr(C++11)
default_delete(C++11)
Garbage soporte colección
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)
Varios
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)
C Library
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
 
Defined in header <cstdlib>
void* calloc( std::size_t num, std::size_t size );
Asigna memoria para un array de objetos num size de tamaño y se inicializa en cero .
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 la asignación se realiza correctamente, devuelve un puntero a la más baja (primera) de bytes en el bloque de memoria asignada que está convenientemente preparada para cualquier tipo de objeto .
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 es cero, el comportamiento depende de la implementación (puntero nulo puede ser devuelta, o algún puntero no nulo puede ser devuelto que no se puede utilizar para acceder al almacenamiento)
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.

Contenido

[editar] Parámetros

num -
número de objetos
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 -
tamaño de cada objeto
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.

[editar] Valor de retorno

Puntero al principio de la memoria recién asignada o NULL si el error se ha producido. El puntero se debe desasignar con 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.

[editar] Notas

Debido a los requisitos de alineación, el número de bytes asignados no es necesariamente igual a 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.

[editar] Ejemplo

[editar] Ver también

C documentation for calloc