C语言各种头文件及其中函数的应用
答案:2 悬赏:50
解决时间 2021-11-15 12:05
- 提问者网友:枫涩帘淞幕雨
- 2021-11-15 06:11
我想知道c语言中的头文件的名称和应用。。最好有其中的函数。。。 还有一个。。我们教师讲可能由系统自动给数组规定大小用的是stdlid.h吧。还联系到指针。。怎么用的。谢谢。我把我所有的百度积分贡献了。。
最佳答案
- 二级知识专家网友:而你却相形见绌
- 2021-11-15 06:41
math.h常用函数包括
int abs (int x);
double acos (double x);
double asin (double x);
double atan (double x);
double atan2 (double y, double x);
double atof (const char *s);
double ceil (double x);
double cos (double x);
double cosh (double x);
double exp (double x);
double fabs (double x);
double floor (double x);
double fmod (double x, double y);
double frexp (double x, int *exponent);
long labs (long x);
double ldexp (double x, int exponent);
double log (double x);
double log10 (double x);
double modf (double x, double *ipart);
double pow (double x, double y);
double sin (double x);
double sinh (double x);
double sqrt (double x);
double tan (double x);
double tanh (double x);
stdio.h常用函数包括
int fclose (FILE *stream);
int fflush (FILE *stream);
int fgetc (FILE *stream);
int fgetpos (FILE *stream, fpos_t *pos);
char * fgets (char *s, int n, FILE *stream);
FILE * fopen (const char *path, const char *mode);
int fprintf (FILE *stream, const char *format, ...);
int fputc (int c, FILE *stream);
int fputs (const char *s, FILE *stream);
size_t fread (void *ptr, size_t size, size_t n, FILE *stream);
FILE * freopen (const char *path, const char *mode,
FILE *stream);
int fscanf (FILE *stream, const char *format, ...);
int fseek (FILE *stream, long offset, int whence);
int fsetpos (FILE *stream, const fpos_t *pos);
long ftell (FILE *stream);
size_t fwrite (const void *ptr, size_t size, size_t n,
FILE *stream);
int printf (const char *format, ...);
int puts (const char *s);
int rename (const char *oldname, const char *newname);
void rewind (FILE *stream);
int scanf (const char *format, ...);
等等
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))
string.h常用函数包括:
char * stpcpy (char *dest, const char *src);
char * strcat (char *dest, const char *src);
char * strchr (const char *s, int c);
int strcmp (const char *s1, const char *s2);
char * strcpy (char *dest, const char *src);
size_t strcspn (const char *s1, const char *s2);
char * strdup (const char *s);
char * strerror(int errnum);
int abs (int x);
double acos (double x);
double asin (double x);
double atan (double x);
double atan2 (double y, double x);
double atof (const char *s);
double ceil (double x);
double cos (double x);
double cosh (double x);
double exp (double x);
double fabs (double x);
double floor (double x);
double fmod (double x, double y);
double frexp (double x, int *exponent);
long labs (long x);
double ldexp (double x, int exponent);
double log (double x);
double log10 (double x);
double modf (double x, double *ipart);
double pow (double x, double y);
double sin (double x);
double sinh (double x);
double sqrt (double x);
double tan (double x);
double tanh (double x);
stdio.h常用函数包括
int fclose (FILE *stream);
int fflush (FILE *stream);
int fgetc (FILE *stream);
int fgetpos (FILE *stream, fpos_t *pos);
char * fgets (char *s, int n, FILE *stream);
FILE * fopen (const char *path, const char *mode);
int fprintf (FILE *stream, const char *format, ...);
int fputc (int c, FILE *stream);
int fputs (const char *s, FILE *stream);
size_t fread (void *ptr, size_t size, size_t n, FILE *stream);
FILE * freopen (const char *path, const char *mode,
FILE *stream);
int fscanf (FILE *stream, const char *format, ...);
int fseek (FILE *stream, long offset, int whence);
int fsetpos (FILE *stream, const fpos_t *pos);
long ftell (FILE *stream);
size_t fwrite (const void *ptr, size_t size, size_t n,
FILE *stream);
int printf (const char *format, ...);
int puts (const char *s);
int rename (const char *oldname, const char *newname);
void rewind (FILE *stream);
int scanf (const char *format, ...);
等等
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))
string.h常用函数包括:
char * stpcpy (char *dest, const char *src);
char * strcat (char *dest, const char *src);
char * strchr (const char *s, int c);
int strcmp (const char *s1, const char *s2);
char * strcpy (char *dest, const char *src);
size_t strcspn (const char *s1, const char *s2);
char * strdup (const char *s);
char * strerror(int errnum);
全部回答
- 1楼网友:初心未变
- 2021-11-15 07:29
先新建一个myhead.h
内容通常自定义文件格式:
#ifndef _myhead_h_
#define _myhead_h_
(这里是头文件的内容)
#endif
然后在你的.c中#include“myhead.h”就可以了
记得放在一个工程目录下
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯