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.

characters. The first time this function is invoked on a particular string,<br />

that string should be passed in s1. After the first time, this function can<br />

continue parsing the string from the last delimiter by invoking it with a<br />

null value passed in s1.<br />

It skips all leading characters that appear in the string s2(delimiters),<br />

then skips all characters not appearing in s2(this segment of<br />

characters is the token), and then overwrites the next character with a<br />

null character, terminating the current token. The function strtokthen<br />

saves a pointer to the character that follows,from which the next<br />

search will start. If strtokfinds the end of the string before it finds a<br />

delimiter, the current token extends tothe end of the string pointed to<br />

by s1. If this is the first call to strtok, it does not modify the string (no<br />

null characters are written to s1). The set of characters that is passed<br />

in s2need not be the samefor each call to strtok.<br />

If strtokis called with a non-null parameter for s1after the initial call,<br />

the string becomes the new string tosearch. The old string previously<br />

searched will be lost.<br />

strstr (Continued)<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

Ngày và thời gian là Sat 01 tháng 2 năm 2003 02:30:30<br />

đồng hồ<br />

Mô tả: Tính toán thời gian xử lý.<br />

Bao gồm:<br />

Prototype: đồng hồ clock_t (void);<br />

Quay trở lại giá trị: Trả về số của đồng hồ bọ ve thời gian xử lý trôi qua.<br />

Ghi chú: Nếu môi trường mục tiêu không thể đo lường thời gian xử lý trôi qua,<br />

các<br />

chức năng trả về -1, vào vai một clock_t. (Tức là (clock_t) -1) Theo mặc định,<br />

MPLAB C30 trả về thời gian là chu kỳ hướng dẫn.<br />

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

2004 Microchip Technology Inc DS51456B trang 319<br />

Ví dụ: # include / * Cho đồng hồ * /<br />

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

dễ bay hơi int i;<br />

int main (void)<br />

{<br />

clock_t bắt đầu, dừng lại;<br />

int ct;<br />

bắt đầu = đồng hồ ();<br />

for (i = 0; i

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

Saved successfully!

Ooh no, something went wrong!