全部博文(92)
分类: 嵌入式
2009-09-02 19:44:59
Reference website:
Reference: "Embedded Linux, C-language programming practice"
In fact, in reference to web pages, you can already find all the C language standard library functions. Here I only list what I learned:
C-set of the standard library functions are:
1. Standard formal input and output class function
Header files are involved in stdio.h and stdarg.h
* scanf function: Format input string
* printf functions: formatting output strings
* putchar function: the output characters to the standard output
* getchar function: get character from standard input
* putc function: output characters to the file
* getc function: get characters from a file
while ((c = getchar ()! = EOF)) putchar (c)
c = getc (pFile)
getchar () is equivalent to getc (stdin)
* gets function: get the string
* puts the function: output the specified string
* ungetc function: the return of characters to write
2. Character processing and conversion functions
* sprintf function: formatted output string to a buffer
sprintf (s, "% d", 123)
sprintf (s, "% 08X", 456); turn 16 hex
sprintf (s, "% 10.3f", 3.1434)
* strcat and strncat functions: string concatenation
char * strncat (char * dest, const char * src, size_t n)
* strcpy and strncpy functions: string copying
char strncpy (char * dest, const char * src, size_t maxlen)
* strcmp and strncmp functions: String Comparison
int strcmp (const char * s1, const char * s2)
s1> s2 return 1
s1 = s2 return 0
s1
* strchr and strrchr function: Character / String location
strchar: search a character position of first occurrence
strrchr: search a character position of last occurrence
* strstr function: string search
* strupr and strlwr function: to convert the letters
* strdup and strndup function: string copying
char * strdup (const char * s)
The string s to copy to the specified memory cell
3. Math class functions counting
div acos atan cos tan cosh exp frexp ldexp log modf pow sqrt ceil abs floor
4. Data structures and algorithms class functions
* bsearch function: binary search
* lfind function: linear search
* lsearch function: linear search
* qsort function: the use of ordered array of quick sort method
* rand function: generate random number
5. File I / O operation class correlation function
* fopen function: open file
* fclose function: close file
* fgetc function: read a character from a file
fp = fopen ( "exit", "r")
while ((c = fgetc (fp))! = EOF)
* fputc function: to a specified character is written to the file stream
* fgets function: read a string from a file
* fputs function: to a specified string into the document
* rewind function: Reset the file position of the file stream to read and write at the beginning of
* ftell function: get the file stream to read position
* fseek function: get the file stream to read position
* fwrite function: to build the file to write to the file stream
* fread function: read data from the file stream
* fgetpos function: get the file location
The stream's current location is recorded in the * position for the subsequent fsetpos () call using the
* fsetpos function: Set File Location
6. Utility functions
* assert function: diagnostic procedures
* setjmp function: to save call