stdlib.h常用函数包括
int abs (int x);
int atexit (atexit_t func);
double atof (const char *s);
int atoi (const char *s);
long atol (const char *s);
void * bsearch(const void *key, const void *base,
size_t nelem, size_t width,
int (*fcmp)());
void * calloc (size_t nitems, size_t size);
div_t div (int numer, int denom);
void exit (int status);
void free (void *block);
char * getenv (const char *name);
long labs (long x);
ldiv_t ldiv (long numer, long denom);
void * malloc (size_t size);
void qsort (void *base, size_t nelem, size_t width,
int (*fcmp)());
int rand (void);
void * realloc(void *block, size_t size);
void srand (unsigned seed);
double strtod (const char *s, char **endptr);
long strtol (const char *s, char **endptr, int radix);
unsigned long strtoul (const char *s, char **endptr, int radix);
int system (const char *command);
max(a,b) (((a) > (b)) ? (a) : (b))
min(a,b) (((a) < (b)) ? (a) : (b))
random(num) (rand() % (num))
randomize() srand((unsigned)time(NULL))
c语言知识 stdlib.h常用函数
最新推荐文章于 2023-12-28 09:46:48 发布