Help with memory allocation functions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Help with memory allocation functions

1,073件の閲覧回数
MQXuser
Contributor III

FILE_PTR   fpr;
fpr = _mem_alloc_zero(4096);
fpr = fopen("c:\\LIMBIC.S19", "r");
fclose(fpr);

 

what does fclose do?, does it free the mem_alloc_zero(4096) ??? 

do I need to call  _mem_free(fpr) ???

do I even need to call _mem_alloc_zero to allocate memory for the file pointer ???

 

Any comments are welcome

0 件の賞賛
返信
1 返信

417件の閲覧回数
eGuy
Contributor IV

 

you don't need to call _mem_alloc_zero.

you don't need to call _mem_free(fpr) either.

 

refer to these files: io_fopen.c and io_fclose.c to understand "fopen" and "fclose"

 

or grab C book, read chapter about io/file etc.