1. #include <assert.h> //设定插入点
  2. #include <ctype.h> //字符处理
  3. #include <errno.h> //定义错误码
  4. #include <float.h> //浮点数处理
  5. #include <fstream.h> //文件输入/输出
  6. #include <iomanip.h> //参数化输入/输出
  7. #include <iostream.h> //数据流输入/输出
  8. #include <limits.h> //定义各种数据类型最值常量
  9. #include <locale.h> //定义本地化函数
  10. #include <math.h> //定义数学函数
  11. #include <stdio.h> //定义输入/输出函数
  12. #include <stdlib.h> //定义杂项函数及内存分配函数
  13. #include <string.h> //字符串处理
  14. #include <strstrea.h> //基于数组的输入/输出
  15. #include <time.h> //定义关于时间的函数
  16. #include <wchar.h> //宽字符处理及输入/输出
  17. #include <wctype.h> //宽字符分类
  18. #include <complex> //复数类
  19. #include <ios> //基本输入/输出支持
  20. #include <iosfwd> //输入/输出系统使用的前置声明
  21. #include <iostream>
  22. #include <istream> //基本输入流
  23. #include <ostream> //基本输出流
  24. #include <queue> //STL 队列容器
  25. #include <set> //STL 集合容器
  26. #include <sstream> //基于字符串的流
  27. #include <stack> //STL 堆栈容器
  28. #include <stdexcept> //标准异常类
  29. #include <streambuf> //底层输入/输出支持
  30. #include <string> //字符串类
  31. #include <utility> //STL 通用模板类
  32. #include <vector> //STL 动态数组容器
  33. #include <dos.h>通用dos中断接口函数
  34. #include <conio.h>)驻留并退出函数

常用函数

程序应包含在math.h

函数类型

函数形式

功能

类型

数学函数

abs(int i)

求整数的绝对值

int

fabs(double x)

返回浮点数的绝对值

double

floor(double x)

向下舍入

double

fmod(double x, double y)

计算x对y的模, 即x/y的余数

double

exp(double x)

指数函数

double

log(double x)

对数函数ln(x)

double

log10(double x)

对数函数log

double

labs(long n)

取长整型绝对值

long

modf(double value, double *iptr)

把数分为指数和尾数

double

pow(double x, double y)

指数函数(x的y次方)

double

sqrt(double x)

计算平方根

double

sin(double x)

正弦函数

double

asin(double x)

反正弦函数

double

sinh(double x)

双曲正弦函数

double

cos(double x);

余弦函数

double

acos(double x)

反余弦函数

double

cosh(double x)

双曲余弦函数

double

tan(double x)

正切函数

double

atan(double x)

反正切函数

double

tanh(double x)

双曲正切函数

double

数学函数

abs(int i)

求整数的绝对值

int

fabs(double x)

返回浮点数的绝对值

double

floor(double x)

向下舍入

double

fmod(double x, double y)

计算x对y的模, 即x/y的余数

double

exp(double x)

指数函数

double

log(double x)

对数函数ln(x)

double

log10(double x)

对数函数log

double

labs(long n)

取长整型绝对值

long

modf(double value, double *iptr)

把数分为指数和尾数

double

pow(double x, double y)

指数函数(x的y次方)

double

sqrt(double x)

计算平方根

double

sin(double x)

正弦函数

double

asin(double x)

反正弦函数

double

sinh(double x)

双曲正弦函数

double

cos(double x);

余弦函数

double

acos(double x)

反余弦函数

double

cosh(double x)

双曲余弦函数

double

tan(double x)

正切函数

double

atan(double x)

反正切函数

double

tanh(double x)

双曲正切函数

double

程序应包含在string.h

函数类型

函数形式

功能

类型

字符串函数

strcat(char *dest,const char *src)

将字符串src添加到dest末尾

char

strchr(const char *s,int c)

检索并返回字符c在字符串s中第一次出现的位置

char

strcmp(const char *s1,const char *s2)

比较字符串s1与s2的大小,并返回s1-s2

int

stpcpy(char
*dest,const char *src)

将字符串src复制到dest

char

strdup(const
char *s)

将字符串s复制到最近建立的单元

char

strlen(const
char *s)

返回字符串s的长度

int

strlwr(char
*s)

将字符串s中的大写字母全部转换成小写字母,并返回转换后的字符串

char

strrev(char
*s)

将字符串s中的字符全部颠倒顺序重新排列,并返回排列后的字符串

char

strset(char
*s,int ch)

将一个字符串s中的所有字符置于一个给定的字符ch

char

strspn(const
char *s1,const char *s2)

扫描字符串s1,并返回在s1和s2中均有的字符个数

char

strstr(const
char *s1,const char *s2)

描字符串s2,并返回第一次出现s1的位置

char

strtok(char
*s1,const char *s2)

检索字符串s1,该字符串s1是由字符串s2中定义的定界符所分隔

char

strupr(char *s)

将字符串s中的小写字母全部转换成大写字母,并返回转换后的字符串

char

程序应包含在ctype.h

函数类型

函数形式

功能

类型

字符函数

isalpha(int 
ch)

若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0

int

isalnum(int  ch)

若ch是字母('A'-'Z','a'-'z')或数字('0'-'9')返回非0值,否则返回0

int

isascii(int 
ch)

若ch是字符(ASCII码中的0-127)返回非0值,否则返回0

int

iscntrl(int 
ch)

若ch是作废字符(0x7F)或普通控制字符(0x00-0x1F)返回非0值,否则返回0

int

isdigit(int 
ch)

若ch是数字('0'-'9')返回非0值,否则返回0

int

isgraph(int  ch)

若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0

int

islower(int 
ch)

若ch是小写字母('a'-'z')返回非0值,否则返回0

int

isprint(int 
ch)

若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0

int

ispunct(int  ch)

若ch是标点字符(0x00-0x1F)返回非0值,否则返回0

int

isspace(int 
ch) 

若ch是空格('  '),水平制表符('\t'),回车符('\r'), 走纸换行('\f'),垂直制表符('\v'),换行符('\n'),返回非0值,否则返回0

int

isupper(int  ch)

若ch是大写字母('A'-'Z')返回非0值,否则返回0

int

isxdigit(int  ch)

若ch是16进制数('0'-'9','A'-'F','a'-'f')返回非0值,否则返回0

int

tolower(int  ch)

若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z')

int

toupper(int  ch)

若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z')

int

程序应包含在stdio.h

函数类型

函数形式

功能

类型

输入输出函数

getch() 

从控制台(键盘)读一个字符,不显示在屏幕上

int

putch() 

向控制台(键盘)写一个字符

int

getchar()

从控制台(键盘)读一个字符,显示在屏幕上

int

putchar() 

向控制台(键盘)写一个字符

int

getchar() 

从控制台(键盘)读一个字符,显示在屏幕上

int

getc(FILE  *stream)

从流stream中读一个字符,并返回这个字符

int

putc(int  ch,FILE  *stream)

向流stream写入一个字符ch

int

getw(FILE  *stream)

从流stream读入一个整数,错误返回EOF

int

putw(int  w,FILE  *stream)

向流stream写入一个整数

int

fclose(handle)

关闭handle所表示的文件处理

FILE
*

fgetc(FILE  *stream)

从流stream处读一个字符,并返回这个字符

int

fputc(int  ch,FILE  *stream)

将字符ch写入流stream中

int

fgets(char  *string,int  n,FILE  *stream)

流stream中读n个字符存入string中

c
har *

fopen(char *filename,char *type)

打开一个文件filename,打开方式为type,并返回这个文件指针,type可为以下字符串加上后缀

FILE
*

fputs(char  *string,FILE  *stream)

将字符串string写入流stream中

int

fread(void  *ptr,int  size,int  nitems,FILE 
*stream)

从流stream中读入nitems个长度为size的字符串存入ptr中

int

fwrite(void  *ptr,int  size,int  nitems,FILE 
*stream)

向流stream中写入nitems个长度为size的字符串,字符串在ptr中

int

fscanf(FILE  *stream,char  *format[,argument,…])

以格式化形式从流stream中读入一个字符串

int

fprintf(FILE  *stream,char  *format[,argument,…])

以格式化形式将一个字符串写给指定的流stream

int

scanf(char *format[,argument…])

从控制台读入一个字符串,分别对各个参数进行赋值,使用BIOS进行输出

int

printf(char *format[,argument,…])

发送格式化字符串输出给控制台(显示器),使用BIOS进行输出

int

C语音常用库和函数的更多相关文章

  1. C++的一些小操作、常用库及函数(持续更新)

    1. 强制保留n位小数(位数不足则强制补零) 头文件: #include <iomanip> 在输出前: cout<<setprecision(n); 也有不用头文件的方式,在 ...

  2. 常用的WinAPI函数整理

    常用的WinAPI函数整理 一.进程  创建进程:    CreateProcess("C:\\windows\\notepad.exe",0,0,0,0,0,0,0,&s ...

  3. 转:不应该不知道C++的常用库

    不应该不知道C++的常用库 非常惭愧,我过去也仅仅了解boost.STLport这样的库,以及一些GUI库,但是居然有如此众多的C++库,其实令我惊讶.当然,这个问题应该辩证的看,对于拿来主义确实可以 ...

  4. 【python游戏编程之旅】第四篇---pygame中加载位图与常用的数学函数。

    本系列博客介绍以python+pygame库进行小游戏的开发.有写的不对之处还望各位海涵. 在上一篇博客中,我们学习了pygame事件与设备轮询.http://www.cnblogs.com/msxh ...

  5. JSP标签JSTL(5)--常用的标签函数

    在使用JSTL的标签函数的时候请务必加上如下代码 <!-- 添加jsp标签的核心库 --> <%@ taglib uri="http://java.sun.com/jsp/ ...

  6. Atitit 数据库 标准库  sdk 函数库 编程语言 mysql oracle  attilax总结

    Atitit 数据库 标准库  sdk 函数库 编程语言 mysql oracle  attilax总结 1.1. 常见的编程语言以及数据库 sql内部函数库标准化库一般有以下api1 1.2. 各个 ...

  7. python中的运算符及表达式及常用内置函数

    知识内容: 1.运算符与表达式 2.for\while初步了解 3.常用内置函数 一.运算符与表达式 python与其他语言一样支持大多数算数运算符.关系运算符.逻辑运算符以及位运算符,并且有和大多数 ...

  8. 常用的OpenCV函数速查

    常用的OpenCV函数速查 1.cvLoadImage:将图像文件加载至内存: 2.cvNamedWindow:在屏幕上创建一个窗口: 3.cvShowImage:在一个已创建好的窗口中显示图像: 4 ...

  9. Altium Designer 10 | 常用库及部分元件名中英文对照表

    ———————————————————————————————————————————— 常用库及部分元件名中英文对照表 - - - - - - - - - - - - - - - - - - - - ...

随机推荐

  1. javascript获取浏览器窗口大小

    var w=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var h= ...

  2. mybatis:Invalid bound statement (not found)

    [常规解决办法] 如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因 ...

  3. Swing图形用户界面

    package test; import java.awt.event.ActionEvent;import java.awt.event.ActionListener; import javax.s ...

  4. bx, bp, si, di寄存器的使用规则

    首先,都可以单独使用. 另外,组合使用的情况下: 记住这张图片就行了=_= 意思就是,bx只能和si,di组合.bp只能和si,di组合.

  5. 【转载】ANSYS完全法与模态叠加法瞬态分析实例

    原文地址:http://www.caetecc.com/thread-2172-1-1.html ! 半脉冲载荷 --- 模态叠加法fini/clear,nostart/PREP7ET,1,BEAM4 ...

  6. IIs安装&发布&解决遇到的问题

    IIS安装: IIS发布: 1.添加网站: 2.将发布的文件,copy到该网站的目录下 3. 刷新,文件显示出来,将其"转换为应用程序” => 4.在应用程序池中找到该网站相应的程序池 ...

  7. linux 模块常用命令

    lsmod | grep pcspkr  查看pcspkr模块是否运行modprobe -r pcspkr   删除pcspkr模块modinfo pcspkr       查看pcspkr模块信息m ...

  8. X86 Socket 通信

    struct txd_socket_handler_t { int fd; }; txd_socket_handler_t *txd_tcp_socket_create() { txd_socket_ ...

  9. How to Remove Table Partitioning in SQL Server

    In this article we will see how we can remove partitions from a table in a database in SQL server. I ...

  10. hadoop streaming 多路输出 [转载]

    转载 http://www.cnblogs.com/shapherd/archive/2012/12/21/2827860.html hadoop 支持reduce多路输出的功能,一个reduce可以 ...