转:C语言头文件下包含函数(math.h stdio.h stdlib.h string.h)

2023-11-01

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常用函数包括

 stdlib 头文件里包含了C、C++语言的一些函数

  该文件包含了的C语言标准库函数的定义

  stdlib.h里面定义了五种类型、一些宏和通用工具函数。 类型例如size_t、wchar_t、div_t、ldiv_t和lldiv_t; 宏例如EXIT_FAILURE、EXIT_SUCCESS、RAND_MAX和MB_CUR_MAX等等; 常用的函数如malloc()、calloc()、realloc()、free()、system()、atoi()、atol()、rand()、 srand()、exit()等等。 具体的内容你自己可以打开编译器的include目录里面的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);

 

conio.h不是C标准库中的头文件。
  conio是Console Input/Output(控制台输入输出)的简写,其中定义了通过控制台进行数据输入和数据输出的函数,主要是一些用户通过按键盘产生的对应操作,比如getch()函数等等。
  包含的函数
  cgets(char *);
  cprintf(const char *, ...);
  cputs(const char *);
  cscanf(const char *, ...);
  inp(unsigned short);
  inpw(unsigned short);
  getch(void);
  getche(void);
  kbhit(void);
  outp(unsigned short, int);
  outpw(unsigned short, unsigned short);
  putch(int);
  ungetch(int);
  void _Cdecl clreol (void);
  void _Cdecl clrscr (void);
  void _Cdecl delline (void);
  int _Cdecl gettext (int left, int top, int right, int bottom,
  void *destin);
  void _Cdecl gettextinfo (struct text_info *r);
  void _Cdecl gotoxy (int x, int y);
  void _Cdecl highvideo (void);
  void _Cdecl insline (void);
  void _Cdecl lowvideo (void);
  int _Cdecl movetext (int left, int top, int right, int bottom,
  int destleft, int desttop);
  void _Cdecl normvideo (void);
  int _Cdecl puttext (int left, int top, int right, int bottom,
  void *source);
  void _Cdecl textattr (int newattr);
  void _Cdecl textbackground (int newcolor);
  void _Cdecl textcolor (int newcolor);
  void _Cdecl textmode (int newmode);
  int _Cdecl wherex (void);
  int _Cdecl wherey (void);
  void _Cdecl window (int left, int top, int right, int bottom);
  har *_Cdecl cgets (char *str);
  int _Cdecl cprintf (const char *format, ...);
  int _Cdecl cputs (const char *str);
  int _Cdecl cscanf (const char *format, ...);
  int _Cdecl getch (void);
  int _Cdecl getche (void);
  char *_Cdecl getpass (const char *prompt);
  int _Cdecl kbhit (void);
  int _Cdecl putch (int c);
  int _Cdecl ungetch (int ch);

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

转:C语言头文件下包含函数(math.h stdio.h stdlib.h string.h) 的相关文章

  • 这种双重实例是否有害,或者根本没有必要?

    在仔细阅读遗留资源时 我发现了这一点 DataSet myUPC new DataSet myUPC dbconn getDataSet dynSQL Resharper 正确地将其中的 new Dataset 部分 灰显 并建议 删除多余
  • 如何使用带有进度条的 HttpClient 下载文件?

    我创建了一个名为SiteDownload并添加了一些下载图像的链接 using System Collections Generic using System Linq using System Net using System Threa
  • TCP客户端;网络流;异步读取; C#

    请原谅我对任务和异步缺乏了解 使用 TcpClient 类 我正在创建与可用服务器的连接 void async RunClientAsync TcpClient client new TcpClient try await client C
  • Web 应用程序框架:C++ 与 Python

    作为一名程序员 我熟悉 Python 和 C 我正在考虑编写自己的简单 Web 应用程序 并且想知道哪种语言更适合服务器端 Web 开发 我正在寻找一些东西 它必须是直观的 我认识到 Wt 存在并且它遵循 Qt 的模型 我讨厌 Qt 的一件
  • 如何在 C# 中启动文件

    编辑 我觉得自己像个白痴 我有一种感觉 像下面的答案会起作用 但没有看到任何与下面的答案类似的谷歌结果 所以当我看到这段复杂的代码时 我想它一定是这样的 我搜索并找到了这个Windows 列出并启动与扩展关联的应用程序 https stac
  • 以概率从列表中选择随机元素

    我有一个包含四个项目 A B C D 的列表 每个项目都有被选择的概率 例如 A 有 74 的机会被选中 B 15 C 7 D 4 我想创建一个函数 根据其概率随机选择一个项目 有什么帮助吗 为您的项目定义一个类 如下所示 class It
  • 如何获取 C# PriorityQueue 元素的优先级

    我正在初始化一个存储 XY 坐标的优先级队列 根据距原点的欧几里得距离确定优先级 我创建了一个自定义Comparer这使得它作为最大堆运行 PriorityQueue
  • 公共领域有哪些替代方案?

    我正在用 java 编写一个游戏 正如问题标题建议的那样 我在类中使用公共字段 暂且 据我所知 公共领域很糟糕 我有一些理解其中的原因 但如果有人能澄清为什么你不应该使用它们 那将不胜感激 问题是 从我所看到的来看 这似乎是合乎逻辑的 是使
  • 析构函数、dispose 和 Finalize 方法之间的区别

    我正在研究垃圾收集器在 C 中的工作原理 我对使用感到困惑Destructor Dispose and Finalize方法 根据我的研究和理解 在我的类中拥有析构函数方法将告诉垃圾收集器以析构函数方法中提到的方式执行垃圾收集 该方法不能在
  • C++ 为非虚方法指定初始化

    我有 a h 如下所示 class A public void doSomething 0 然后我有 b h 如下所示 include a h class b public A public void doSomething 我只是想通过尝
  • 如何设置cookie值?

    我正在执行以下操作来设置 cookie 值 HttpCookie mycookie new HttpCookie mycookie mycookie Value value1 Case sensitivity mycookie Expire
  • C++20 views::join 在生成的嵌套范围::single_view 上进入无限循环

    我正在使用 GCC 实现 v10 2 和 v11 来处理 C 20 范围 测试的行为std views join https en cppreference com w cpp ranges join view 我尝试使用生成嵌套视图sin
  • 向窗口句柄发送消息

    我尝试使用 sendmessage 将消息从我的 C 应用程序传递到 C 我的c 代码是这样的 int tmain int argc TCHAR argv COPYDATASTRUCT cpd cpd dwData 0 LPCWSTR st
  • 我们可以使用 C# 录制发送到扬声器的声音吗

    我有一个软件 SoundTap Streaming Audio Recorder 它记录发送到扬声器的任何音频 无论流是来自网络还是来自某些文件或麦克风 我可以在桌面应用程序中制作这样的应用程序 以便我可以录制发送到扬声器的流 无论来源如何
  • 使用 System.Json 迭代 JSON

    我正在探索 NET 4 5 的功能System Json库 但没有太多文档 而且由于流行的 JSON NET 库 搜索起来相当棘手 我基本上想知道 我如何循环一些 JSON 例如 People Simon Age 25 Steve Age
  • Lambda 按值捕获和“mutable”关键字

    关键词的必要性mutable在 lambda 中 是造成极大混乱的根源 考虑代码 int x 10 function
  • 定义一个断言,即使定义了 NDEBUG,该断言也有效

    我想定义一个assert与标准相同的宏assert 3 http man7 org linux man pages man3 assert 3 html调用 但它不会被预处理器删除NDEBUG被定义为 这样的呼唤 让我们称之为assert2
  • 使用 /clr 或 clr:pure(cpprestsdk 又名 casablanca)编译时不支持互斥

    我创建一个CLR project in visual c with 64 bit配置 并尝试使用cpprestsdk aka casablanca 64bit 但是当我运行项目时 出现了错误 1 gt Build started Proje
  • 在 Visual Studio C++ 资源编辑器中导入 png 文件

    我希望能够在 Visual Studio 资源编辑器中导入 png 文件 以便能够在不同的其他项目中使用嵌入的资源 有解决办法吗 我知道它适用于位图 但我对 png 感兴趣 因为即使在较低格式 16x16 或 32x32 上也可以使用 透明
  • 返回右值 - 这段代码有什么问题? [复制]

    这个问题在这里已经有答案了 我遇到了以下代码片段 std string test std string m Hello return std move m int main std string m test 我知道上面的代码是不正确且不安

随机推荐