|
Cet article a fait l'objet d'une traduction automatique. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
calloc
void *calloc( size_t num, size_t size );
_set_new_mode(1)
|
|
|
|---|---|
|
calloc |
|
// crt_calloc.c
// This program uses calloc to allocate space for
// 40 long integers. It initializes each element to zero.
#include <stdio.h>
#include <malloc.h>
int main( void )
{
long *buffer;
buffer = (long *)calloc( 40, sizeof( long ) );
if( buffer != NULL )
printf( "Allocated 40 long integers\n" );
else
printf( "Can't allocate memory\n" );
free( buffer );
}
alloué 40 longs entiers Non applicable. Pour appeler la fonction C standard, utilisez PInvoke. Pour plus d'informations, consultez l' exemples d'appel de code non managé.