C C C-1 <stdio.h> C -2 <ctype.h> C -3 <string.h> C -4 <math.h> C -5 / <time.h> C -6 <stdlib.h>
2 C/C++ C-1 <stdio.h> FILE* fopen(const char* filename, const char* mode) filename NULL FILE* freopen(const char* filename, const char* mode, FILE* stream) int fflush(file* stream) 0 EOF int fclose(file* stream) int remove(const char* filename) int rename(const char* oldname, const char* newname) oldname newname FILE* tmpfile() "wb+" char* tmpname(char s[l_tmpnam]) s int setvbuf(file* stream, char* buf, int mode, size_t size) size mode _IOFBF _IOLBF _IONBF void setbuf(file* stream, char* buf) buf int fprintf(file* stream, const char* format,...)
C C 3 int printf(const char* format,...) int sprintf(char* s, const char* format,...) s int fscanf(file* stream, const char* format,...) int scanf(const char* format,...) int sscanf(char* s, const char* format,...) s int fgetc(file* stream) char* fgets(char* s, int n, FILE* stream) int fputc(int c, FILE* stream) char* fputs(const char* s, FILE* stream) int getc(file* stream) int getchar(void) char* gets(char* s) int putc(int c, FILE* stream) int putchar(int c) int puts(const char* s)
4 C/C++ int ungetc(int c, FILE* stream) size_t fread(void* ptr, size_t size, size_t nobj, FILE* stream) size_t fwrite(const void* ptr, size_t size, size_t nobj, FILE* stream) int fseek(file* stream, long offset, int origin) offset origin SEEK_SET SEEK_CUR SEEK_END long ftell(file* stream) void rewind(file* stream) int feof(file* stream) int ferror(file* stream) C-2 <ctype.h> int isalnum(int c) isalpha(c) isdigit(c) int isalpha(int c) isupper(c) islower(c) int iscntrl(int c) ASCII int isdigit(int c) int isgraph(int c) int islower(int c)
C C 5 int isprint(int c) 0x20 (' ') 0x7E ('~') int ispunct(int c) int isspace(int c) int isupper(int c) int isxdigit(int c) int tolower(int c) int toupper(int c) C-3 <string.h> char* strcpy(char* s, const char* ct) s char* strncpy(char* s, const char* ct, size_t n) ct n s char* strcat(char* s, const char* ct) s char* strncat(char* s, const char* ct, size_t n) ct n s int strcmp(const char* cs, const char* ct) cs ct int strncmp(const char* cs, const char* ct, size_t n) cs ct n char* strchr(const char* cs, int c) c cs
6 C/C++ char* strrchr(const char* cs, int c) c cs char* strpbrk(const char* cs, const char* ct) cs char* strstr(const char* cs, const char* ct) cs size_t strlen(const char* cs) cs char* strerror(int n) char* strtok(char* s, const char* t) t s token void* memcpy(void* s, const void* ct, size_t n) ct n s void* memmove(void* s, const void* ct, size_t n) ct n s int memcmp(const void* cs, const void* ct, size_t n) ct cs n void* memchr(const void* cs, int c, size_t n) cs n c void* memset(void* s, int c, size_t n) cs n c s
C C 7 C-4 <math.h> double exp(double x) e^x double log(double x) logx double log10(double x) log 10 x double pow(double x, double y) x y x^y double sqrt(double x) x double ceil(double x) x double double floor(double x) x double double fabs(double x) x hypot(double x, double y) (x^ 2+y^ 2) double ldexp(double x, int n) x 2 n x*2^n double frexp(double x, int* exp) x x = m*2^exp m exp double modf(double x, double* ip) x ip double fmod(double x, double y) y x/y double sin(double x)
8 C/C++ double cos(double x) double tan(double x) double asin(double x) double acos(double x) double atan(double x) double atan2(double y, double x) y/x double sinh(double x) hyperbolic sinh(x)=(e^x-e^(-x))/2 double cosh(double x) hyperbolic cosh(x)=(e^x+e^(- x))/2 double tanh(double x) hyperbolic x))/(e^2+e^(-x)) tanh(x)=(e^x-e^(- C-5 / <time.h> clock_t clock(void) CPU ticks CLK_TCK time_t time(time_t* tp) Calendar Time tp -1 double difftime(time_t time2, time_t time1) time2 time1 time2-time1 time_t mktime(struct tm* tp) *tp -1
C C 9 char* asctime(const struct tm* tp) tm / \n char* ctime(const time_t* tp) time_t / \n struct tm* gmtime(const time_t* tp) time_t UTC Coordinated Universal Time / tm struct tm* localtime(const time_t* tp) time_t / tm size_t strftime(char* s, size_t smax, const char* fmt, const struct tm* tp) / fmt s s smax C-6 <stdlib.h> int abs(int n) long labs(long n) n double atof(const char* s) s 0.0 int atoi(const char* s) s 0 long atol(const char* s) s 0 double strtod(const char* s, char** endp) s endp
10 C/C++ long strtol(const char* s, char** endp, int base) s endp unsigned long strtoul(const char* s, char** endp, int base) strtol void* calloc(size_t nobj, size_t size) nobj nobj size 0 NULL void* malloc(size_t size) NULL void* realloc(void* p, size_t size) p size 0 NULL void free(void* p) p void abort() raise(sigabrt) void exit(int status) 0 int system(const char* s) s MS-DOS char* getenv(const char* name) NULL
C C 11 void* bsearch(const void* key, const void* base, size_t n, size_t size, int (*cmp)(const void* keyval, const void* datum)) base key n size NULL void qsort(void* base, size_t n, size_t size, int (*cmp)(const void*, const void*)) base n size int rand(void) 0 RAND_MAX 0x7FFF void srand(unsigned int seed) 1