转: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) 的相关文章

  • 编译时运算符

    有人可以列出 C 中可用的所有编译时运算符吗 C 中有两个运算符 无论操作数如何 它们的结果始终可以在编译时确定 它们是sizeof 1 and 2 当然 其他运算符的许多特殊用途可以在编译时解决 例如标准中列出的那些整数常量表达式 1 与
  • 如何使用 C# 中的参数将用户重定向到 paypal

    如果我有像下面这样的简单表格 我可以用它来将用户重定向到 PayPal 以完成付款
  • WCF RIA 服务 - 加载多个实体

    我正在寻找一种模式来解决以下问题 我认为这很常见 我正在使用 WCF RIA 服务在初始加载时将多个实体返回给客户端 我希望两个实体异步加载 以免锁定 UI 并且我想利用 RIA 服务来执行此操作 我的解决方案如下 似乎有效 这种方法会遇到
  • 按成员序列化

    我已经实现了template
  • 为什么当实例化新的游戏对象时,它没有向它们添加标签? [复制]

    这个问题在这里已经有答案了 using System Collections using System Collections Generic using UnityEngine public class Test MonoBehaviou
  • 从Web API同步调用外部api

    我需要从我的 Web API 2 控制器调用外部 api 类似于此处的要求 使用 HttpClient 从 Web API 操作调用外部 HTTP 服务 https stackoverflow com questions 13222998
  • 用于登录 .NET 的堆栈跟踪

    我编写了一个 logger exceptionfactory 模块 它使用 System Diagnostics StackTrace 从调用方法及其声明类型中获取属性 但我注意到 如果我在 Visual Studio 之外以发布模式运行代
  • OleDbDataAdapter 未填充所有行

    嘿 我正在使用 DataAdapter 读取 Excel 文件并用该数据填充数据表 这是我的查询和连接字符串 private string Query SELECT FROM Sheet1 private string ConnectStr
  • 关于 C++ 转换:参数 1 从“[some_class]”到“[some_class]&”没有已知的转换

    我正在研究 C 并且遇到了一个错误 我不知道确切的原因 我已经找到了解决方案 但仍然想知道原因 class Base public void something Base b int main Base b b something Base
  • 重载<<的返回值

    include
  • 显示UnityWebRequest的进度

    我正在尝试使用下载 assetbundle统一网络请求 https docs unity3d com ScriptReference Networking UnityWebRequest GetAssetBundle html并显示进度 根
  • SolrNet连接说明

    为什么 SolrNet 连接的容器保持静态 这是一个非常大的错误 因为当我们在应用程序中向应用程序发送异步请求时 SolrNet 会表现异常 在 SolrNet 中如何避免这个问题 class P static void M string
  • 垃圾收集器是否在单独的进程中运行?

    垃圾收集器是否在单独的进程中启动 例如 如果我们尝试测量某段代码所花费的进程时间 并且在此期间垃圾收集器开始收集 它会在新进程上启动还是在同一进程中启动 它的工作原理如下吗 Code Process 1 gt Garbage Collect
  • 如何查看网络连接状态是否发生变化?

    我正在编写一个应用程序 用于检查计算机是否连接到某个特定网络 并为我们的用户带来一些魔力 该应用程序将在后台运行并执行检查是否用户请求 托盘中的菜单 我还希望应用程序能够自动检查用户是否从有线更改为无线 或者断开连接并连接到新网络 并执行魔
  • 对现有视频添加水印

    我正在寻找一种用 C 在视频上加水印的方法 就像在上面写文字一样 图片或文字标签 我该怎么做 谢谢 您可以使用 Nreco 视频转换器 代码看起来像 NReco VideoConverter FFMpegConverter wrap new
  • 为什么编译时浮点计算可能不会得到与运行时计算相同的结果?

    In the speaker mentioned Compile time floating point calculations might not have the same results as runtime calculation
  • 基于 OpenCV 边缘的物体检测 C++

    我有一个应用程序 我必须检测场景中某些项目的存在 这些项目可以旋转并稍微缩放 更大或更小 我尝试过使用关键点检测器 但它们不够快且不够准确 因此 我决定首先使用 Canny 或更快的边缘检测算法 检测模板和搜索区域中的边缘 然后匹配边缘以查
  • 测试用例执行完成后,无论是否通过,如何将测试用例结果保存在变量中?

    我正在使用 NUNIT 在 Visual Studio 中使用 Selenium WebDriver 测试用例的代码是 我想在执行测试用例后立即在变量中记录测试用例通过或失败的情况 我怎样才能实现这一点 NUnit 假设您使用 NUnit
  • C# 模拟VolumeMute按下

    我得到以下代码来模拟音量静音按键 DllImport coredll dll SetLastError true static extern void keybd event byte bVk byte bScan int dwFlags
  • Windows 和 Linux 上的线程

    我在互联网上看到过在 Windows 上使用 C 制作多线程应用程序的教程 以及在 Linux 上执行相同操作的其他教程 但不能同时用于两者 是否存在即使在 Linux 或 Windows 上编译也能工作的函数 您需要使用一个包含两者的实现

随机推荐