30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

epresenting the precision that specifies one of the following:<br />

- minimum number of digits to generate on an integer conversion<br />

- number of fraction digits to generate on an e, E, or f conversion<br />

- maximum number of significant digits to generate on a g or G<br />

conversion<br />

- maximum number of characters to generate from a C string on an<br />

s conversion<br />

If the period appears without the integer the integer is assumed to<br />

be zero. If the asterisk (*) is used instead of a decimal number, the<br />

next argument (which must be of type int) will be used for the<br />

precision.<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

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

size<br />

h modifier - used with type d, i, o,u, x, X; converts the value to a<br />

short intor unsigned short int<br />

h modifier - used with n; specifies that the pointer points to a<br />

short int<br />

l modifier - used with type d, i, o,u, x, X; converts the value to a<br />

long intor unsigned long int<br />

l modifier - used with n; specifies that the pointer points to a<br />

long int<br />

l modifier - used with c; specifies a wide character<br />

l modifier - used with type e, E, f, F, g, G; converts the value to a<br />

double<br />

ll modifier - used with type d, i, o,u, x, X; converts the value to a<br />

long long intor unsigned long long int<br />

ll modifier - used with n; specifies that the pointer points to a<br />

long long int<br />

L modifier - used with e, E, f, g, G; converts the value to a long<br />

double<br />

type<br />

d, i signed int<br />

o unsigned intin octal<br />

u unsigned intin decimal<br />

x unsigned intin lowercase hexadecimal<br />

X unsigned intin uppercase hexadecimal<br />

Ví dụ: # include / * Cho putchar, printf, * /<br />

/ * Kết thúc tập tin, thiết bị xuất chuẩn * /<br />

int main (void)<br />

{<br />

char * y;<br />

char buf [] = "Đây là văn bản \ n";<br />

int x;<br />

x = 0;<br />

cho (y = buf; (x = EOF) && (* y = '\ 0');! y ++!)<br />

x = putchar (* y);<br />

}<br />

Đầu ra:<br />

Đây là văn bản<br />

puts<br />

Mô tả: Đặt một chuỗi thiết bị xuất chuẩn.<br />

Bao gồm:<br />

Nguyên mẫu: int puts (const char * s);<br />

Đối số: s chuỗi được viết<br />

Quay trở lại giá trị: Trả về một giá trị không âm nếu thành công; nếu không, trả<br />

về EOF.<br />

Ghi chú: Các chức năng ghi ký tự đến thiết bị xuất chuẩn dòng. Một dòng mới<br />

nhân vật được nối. Các ký tự null chấm dứt được không được ghi vào<br />

dòng.<br />

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

int main (void)<br />

{<br />

char buf [] = "Đây là văn bản \ n";<br />

đặt (buf);<br />

đặt ("|");<br />

}<br />

Đầu ra:<br />

Đây là văn bản<br />

|<br />

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

2004 Microchip Technology Inc DS51456B trang 257<br />

loại bỏ<br />

Mô tả: Xóa các tập tin được chỉ định.<br />

Bao gồm:<br />

Nguyên mẫu: int remove (const char * filename);<br />

Đối số: tên tên tập tin của tập tin bị xóa.

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

Saved successfully!

Ooh no, something went wrong!