-

差分

移動先: 案内検索

Functions HI-TECH C REALLOC

791 バイト追加, 2017年12月23日 (土) 06:34
ページの作成:「<strong>REALLOC</strong> ==概要== void * realloc(void * ptr, size_t cnt) ==詳細== <strong>Realloc</strong>()は事前に<strong>malloc</strong>()、<strong>calloc...」
<strong>REALLOC</strong>
==概要==

void * realloc(void * ptr, size_t cnt)


==詳細==
<strong>Realloc</strong>()は事前に<strong>malloc</strong>()、<strong>calloc</strong>()、<strong>realloc</strong>()などで取得してあったptrからのブロックメモリを解放し、ダイナミックメモリをcntバイト確保しようとします。成功した場合にはptrにあるメモリブロックを新しいブロックにコピーします。
<strong>realloc</strong>()は古いブロック内の多くのバイトをなるべく多く??コピーしようとしますが、新しいブロックの方が小さい場合、cntバイトのみコピーします。ブロックが割り当てできない場合、0が返ります。

==参照==

malloc, calloc, realloc

案内メニュー