c语言知识 stdlib.h常用函数

来源:互联网 发布:手机商城html源码 编辑:程序博客网 时间:2024/05/20 09:48

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))

原创粉丝点击