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.

• src\libm– source code for math library functions, batch file to rebuild the<br />

library<br />

• support\h– header files for libraries<br />

4.1.3 Chapter Organization<br />

This chapter is organized as follows:<br />

• Using the Standard C Libraries<br />

libc-omf.a<br />

• diagnostics<br />

• character handling<br />

• errors<br />

• floating-point characteristics<br />

• implementation-defined limits<br />

• localization<br />

• non-local jumps<br />

• signal handling<br />

• variable argument lists<br />

• common definitions<br />

• input and output<br />

• utility functions<br />

• string functions<br />

• date and time functions<br />

libm-omf.a<br />

• mathematical functions<br />

libpic30-omf.a<br />

• pic30-libs<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

DS51456B-page 194<br />

2004 Microchip Technology Inc.<br />

4.2 USING THE STANDARD C LIBRARIES<br />

Building an application which utilizes the standard C libraries requires two<br />

types of files:<br />

header files and library files.<br />

4.2.1 Header Files<br />

All standard C library entities are declared or defined in one or more standard<br />

headers<br />

(See list in Section 4.1.3 “Chapter Organization”.) To make use of a library<br />

entity in<br />

a program, write an include directive that names the relevant standard header.<br />

The contents of a standard header is included by naming it in an include<br />

directive, as in:<br />

{<br />

int ch;<br />

ch = '3';<br />

if (isalnum (ch))<br />

printf ("3 là một chữ \ n");<br />

khác<br />

printf ("3 là chữ số NOTan \ n");<br />

ch = '#';<br />

if (isalnum (ch))<br />

printf ("# là một chữ \ n");<br />

khác<br />

printf ("# là chữ số NOTan \ n");<br />

}<br />

Đầu ra:<br />

3 là một chữ số<br />

# Là không một chữ số<br />

isalpha<br />

Mô tả: Kiểm tra cho một ký tự chữ cái.<br />

Bao gồm:<br />

Nguyên mẫu: int isalpha (int c);<br />

Đối số: c Các nhân vật để kiểm tra.<br />

Quay trở lại giá trị: Trả về một số nguyên nhân vật khác không có giá trị ifthe là<br />

chữ cái;<br />

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

Ghi chú: ký tự chữ cái được bao gồm trong phạm vi AZ hoặc az.<br />

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

2004 Microchip Technology Inc DS51456B trang 197<br />

Ví dụ: # include / * Cho isalpha * /<br />

# include / * Cho printf * /<br />

int main (void)<br />

{<br />

int ch;<br />

ch = 'B';<br />

if (isalpha (ch))<br />

printf ("B là chữ cái \ n");<br />

khác<br />

printf ("B isnot chữ cái \ n");<br />

ch = '#';<br />

if (isalpha (ch))<br />

printf ("# là chữ cái \ n");

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

Saved successfully!

Ooh no, something went wrong!