30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

_IOLBF<br />

Description: Indicates line buffering.<br />

Include: <br />

Remarks: Used by the function setvbuf.<br />

_IONBF<br />

Description: Indicates no buffering.<br />

Include: <br />

Remarks: Used by the function setvbuf.<br />

BUFSIZ<br />

Description: Defines the size of the buffer used by the function setbuf.<br />

Include: <br />

Value: 512<br />

Standard C Libraries with Math Functions<br />

2004 Microchip Technology Inc. DS51456B-page 227<br />

EOF<br />

Description: A negative number indicating the end-of-file has been reached or<br />

to<br />

report an error condition.<br />

Include: <br />

Remarks: If an end-of-file is encountered, the end-of-file indicator is set. If an<br />

error condition is encountered, the error indicator is set. Error<br />

conditions include write errorsand input or read errors.<br />

FILENAME_MAX<br />

Description: Maximum number of characters in a filename including the null<br />

terminator.<br />

Include: <br />

Value: 260<br />

FOPEN_MAX<br />

Description: Defines the maximum number of files that can be simultaneously<br />

open<br />

Include: <br />

Value: 8<br />

Remarks: stderr, stdinand stdoutare included in the FOPEN_MAXcount.<br />

L_tmpnam<br />

Description: Defines the number of characters for the longest temporary<br />

filename<br />

created by the function tmpnam.<br />

Include: <br />

Value: 16<br />

Remarks: L_tmpnamis used to define the size of the array used by tmpnam.<br />

fclose<br />

Mô tả: Đóng một dòng suối.<br />

Bao gồm:<br />

Nguyên mẫu: int fclose (FILE * stream);<br />

Đối số: dòng con trỏ đến dòng đóng cửa<br />

Quay trở lại giá trị: Trả về 0 nếu thành công; nếu không, trả về EOF nếu có sai<br />

sót là<br />

phát hiện.<br />

Bình luận: fclosewrites bất kỳ sản lượng đệm vào tập tin.<br />

Ví dụ: # include / * Cho fopen, fclose, * /<br />

/ * Printf, FILE, NULL, kết thúc tập tin * /<br />

int main (void)<br />

{<br />

FILE * myfile1, * myfile2;<br />

int y;<br />

if ((myfile1 = fopen ("afile1", "w +")) == NULL)<br />

printf ("Không thể mở afile1 \ n");<br />

khác<br />

{<br />

printf ("afile1 được mở \ n");<br />

y = fclose (myfile1);<br />

if (y == EOF)<br />

printf ("afile1 đã không đóng cửa \ n");<br />

khác<br />

printf ("afile1 đã được đóng cửa \ n");<br />

}<br />

}<br />

Đầu ra:<br />

afile1 đã được mở<br />

afile1 đã bị đóng cửa<br />

Thư viện chuẩn C với hàm toán học<br />

2004 Microchip Technology Inc DS51456B trang 231<br />

feof<br />

Mô tả: Các thử nghiệm về kết thúc của file<br />

Bao gồm:<br />

Nguyên mẫu: int feof (FILE * stream);<br />

Đối số: dòng dòng để kiểm tra kết thúc của file<br />

Quay trở lại giá trị: Trả về giá trị khác không nếu dòng là ở phần cuối của tập<br />

tin; nếu không, trả về số không.<br />

Ví dụ: # include / * Cho feof, fgetc, fputc, * /

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!