Cの
■ このスレッドは過去ログ倉庫に格納されています
0001名無しさんi4004
NGNGの使用方法の指南お願いします。
0002デフォルトの名無しさん
NGNGまずこの板の雰囲気を理解してから適切なスレッドに質問して
頂く様、お願いします。
0003全てはリリンの流れのままに(藁
NGNG0004>>1
NGNG0005デフォルトの名無しさん
NGNG0006デフォルトの名無しさん
NGNG--------------------------------------------
void *malloc( size_t size );
--------------------------------------------
使用例:
#include <stdlib.h> /* For _MAX_PATH definition */
#include <stdio.h>
#include <malloc.h>
void main( void )
{
char *string;
/* Allocate space for a path name */
string = malloc( _MAX_PATH );
if( string == NULL )
printf( "Insufficient memory available\n" );
else
{
printf( "Memory space allocated for path name\n" );
free( string );
printf( "Memory freed\n" );
}
}
--------------------------------------------
void *calloc( size_t num@` size_t size );
--------------------------------------------
使用例:
#include <stdio.h>
#include <malloc.h>
void 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 );
}
0007デフォルトの名無しさん
NGNGおれこれしってる〜
さっき本で勉強したばかりだもんね!
*は関節塩山死でsh〜
■ このスレッドは過去ログ倉庫に格納されています