FREAD

Section: ¸®´ª½º ÇÁ·Î±×·¡¸Ó ¸Å´º¾ó (3)
Updated: 1996³â 5¿ù 17ÀÏ
Index
Return to Main Contents
 

À̸§

fread, fwrite - ÀÌÁø(¹ÙÀ̳ʸ®) ½ºÆ®¸² ÀÔ·Â/Ãâ·Â  

»ç¿ë¹ý

#include <stdio.h>

size_t fread( void *ptr, size_t size, size_t nmemb, FILE *stream);

size_t fwrite( const void *ptr, size_t size, size_t nmemb, FILE *stream);  

¼³¸í

ÇÔ¼ö fread ´Â streamÀÌ °¡¸®Å°´Â ½ºÆ®¸²¿¡¼­ °¢ size ¹ÙÀÌÆ® ¸¸Å­ ±ä µ¥ÀÌÅÍÀÇ nmemb ¿ä¼Ò¸¦ Àоî, ptrÀÌ °¡¸®Å°´Â À§Ä¡¿¡ ÀÐÀº µ¥ÀÌÅ͵éÀ» ÀúÀåÇÑ´Ù.

ÇÔ¼ö fwrite ´Â ptrÀÌ °¡¸®Å°´Â À§Ä¡¿¡ ÀÖ´Â µ¥ÀÌÅ͵éÀ» ¾ò¾î¼­ °¢ size ¹ÙÀÌÆ® ¸¸Å­ ±ä µ¥ÀÌÅÍÀÇ nmemb ¿ä¼Ò¸¦ streamÀÌ °¡¸®Å°´Â À§Ä¡ÀÇ ½ºÆ®¸²¿¡ ¾´´Ù.  

¹Ýȯ°ª

fread ±×¸®°í fwrite ´Â ¼º°øÀûÀ¸·Î ÀÐ°í ¾´ Ç׸ñ(item)ÀÇ ¼ö¸¦ ¹ÝȯÇÑ´Ù.(Áï, ¹®ÀÚµé¼ö°¡ ¾Æ´Ï´Ù.) ¸¸ÀÏ ¿¡·¯°¡ ¹ß»ýÇϰųª EOF¿¡ µµÂøÇÑ´Ù¸é, ¹Ýȯ °ªÀº Ç׸ñ ¼ö(¶Ç´Â 0)ÀÌ´Ù.

fread ´Â EOF¿Í ¿¡·¯¸¦ ±¸ºÐÇÏÁö ¾Ê´Â´Ù. ±×¸®°í È£ÃâÀÚ´Â ¹«¾ùÀÌ ÀϾ´ÂÁö¸¦ °áÁ¤ Çϱâ À§ÇØ feof(3) ¿Í ferror(3) ¸¦ »ç¿ëÇØ¾ß ÇÑ´Ù.  

°ü·Ã Ç׸ñ

feof(3), ferror(3), read(2), write(2)  

Ç¥ÁØ

ÇÔ¼ö fread ¿Í fwrite ´Â ANSI C3.159-1989 (``ANSI C'') ȣȯÀÌ´Ù.  

¿ªÀÚ

Á¤°­ÈÆ <skyeyes@soback.kornet.net>, 2001³â 5¿ù 1ÀÏ


 

Index

À̸§
»ç¿ë¹ý
¼³¸í
¹Ýȯ°ª
°ü·Ã Ç׸ñ
Ç¥ÁØ
¿ªÀÚ

This document was created by man2html, using the manual pages.
Time: 08:07:01 GMT, March 25, 2004