C语音常用库和函数
#include <assert.h> //设定插入点
#include <ctype.h> //字符处理
#include <errno.h> //定义错误码
#include <float.h> //浮点数处理
#include <fstream.h> //文件输入/输出
#include <iomanip.h> //参数化输入/输出
#include <iostream.h> //数据流输入/输出
#include <limits.h> //定义各种数据类型最值常量
#include <locale.h> //定义本地化函数
#include <math.h> //定义数学函数
#include <stdio.h> //定义输入/输出函数
#include <stdlib.h> //定义杂项函数及内存分配函数
#include <string.h> //字符串处理
#include <strstrea.h> //基于数组的输入/输出
#include <time.h> //定义关于时间的函数
#include <wchar.h> //宽字符处理及输入/输出
#include <wctype.h> //宽字符分类
#include <complex> //复数类
#include <ios> //基本输入/输出支持
#include <iosfwd> //输入/输出系统使用的前置声明
#include <iostream>
#include <istream> //基本输入流
#include <ostream> //基本输出流
#include <queue> //STL 队列容器
#include <set> //STL 集合容器
#include <sstream> //基于字符串的流
#include <stack> //STL 堆栈容器
#include <stdexcept> //标准异常类
#include <streambuf> //底层输入/输出支持
#include <string> //字符串类
#include <utility> //STL 通用模板类
#include <vector> //STL 动态数组容器
#include <dos.h>通用dos中断接口函数
#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 |
将字符串src复制到dest |
char |
|||
|
strdup(const |
将字符串s复制到最近建立的单元 |
char |
|||
|
strlen(const |
返回字符串s的长度 |
int |
|||
|
strlwr(char |
将字符串s中的大写字母全部转换成小写字母,并返回转换后的字符串 |
char |
|||
|
strrev(char |
将字符串s中的字符全部颠倒顺序重新排列,并返回排列后的字符串 |
char |
|||
|
strset(char |
将一个字符串s中的所有字符置于一个给定的字符ch |
char |
|||
|
strspn(const |
扫描字符串s1,并返回在s1和s2中均有的字符个数 |
char |
|||
|
strstr(const |
描字符串s2,并返回第一次出现s1的位置 |
char |
|||
|
strtok(char |
检索字符串s1,该字符串s1是由字符串s2中定义的定界符所分隔 |
char |
|||
|
strupr(char *s) |
将字符串s中的小写字母全部转换成大写字母,并返回转换后的字符串 |
char |
|||
|
程序应包含在ctype.h |
|||||
|
函数类型 |
函数形式 |
功能 |
类型 |
||
|
字符函数 |
isalpha(int |
若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0 |
int |
||
|
isalnum(int ch) |
若ch是字母('A'-'Z','a'-'z')或数字('0'-'9')返回非0值,否则返回0 |
int |
|||
|
isascii(int |
若ch是字符(ASCII码中的0-127)返回非0值,否则返回0 |
int |
|||
|
iscntrl(int |
若ch是作废字符(0x7F)或普通控制字符(0x00-0x1F)返回非0值,否则返回0 |
int |
|||
|
isdigit(int |
若ch是数字('0'-'9')返回非0值,否则返回0 |
int |
|||
|
isgraph(int ch) |
若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0 |
int |
|||
|
islower(int |
若ch是小写字母('a'-'z')返回非0值,否则返回0 |
int |
|||
|
isprint(int |
若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0 |
int |
|||
|
ispunct(int ch) |
若ch是标点字符(0x00-0x1F)返回非0值,否则返回0 |
int |
|||
|
isspace(int |
若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 |
|||
|
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中读入nitems个长度为size的字符串存入ptr中 |
int |
|||
|
fwrite(void *ptr,int size,int nitems,FILE |
向流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语音常用库和函数的更多相关文章
- C++的一些小操作、常用库及函数(持续更新)
1. 强制保留n位小数(位数不足则强制补零) 头文件: #include <iomanip> 在输出前: cout<<setprecision(n); 也有不用头文件的方式,在 ...
- 常用的WinAPI函数整理
常用的WinAPI函数整理 一.进程 创建进程: CreateProcess("C:\\windows\\notepad.exe",0,0,0,0,0,0,0,&s ...
- 转:不应该不知道C++的常用库
不应该不知道C++的常用库 非常惭愧,我过去也仅仅了解boost.STLport这样的库,以及一些GUI库,但是居然有如此众多的C++库,其实令我惊讶.当然,这个问题应该辩证的看,对于拿来主义确实可以 ...
- 【python游戏编程之旅】第四篇---pygame中加载位图与常用的数学函数。
本系列博客介绍以python+pygame库进行小游戏的开发.有写的不对之处还望各位海涵. 在上一篇博客中,我们学习了pygame事件与设备轮询.http://www.cnblogs.com/msxh ...
- JSP标签JSTL(5)--常用的标签函数
在使用JSTL的标签函数的时候请务必加上如下代码 <!-- 添加jsp标签的核心库 --> <%@ taglib uri="http://java.sun.com/jsp/ ...
- Atitit 数据库 标准库 sdk 函数库 编程语言 mysql oracle attilax总结
Atitit 数据库 标准库 sdk 函数库 编程语言 mysql oracle attilax总结 1.1. 常见的编程语言以及数据库 sql内部函数库标准化库一般有以下api1 1.2. 各个 ...
- python中的运算符及表达式及常用内置函数
知识内容: 1.运算符与表达式 2.for\while初步了解 3.常用内置函数 一.运算符与表达式 python与其他语言一样支持大多数算数运算符.关系运算符.逻辑运算符以及位运算符,并且有和大多数 ...
- 常用的OpenCV函数速查
常用的OpenCV函数速查 1.cvLoadImage:将图像文件加载至内存: 2.cvNamedWindow:在屏幕上创建一个窗口: 3.cvShowImage:在一个已创建好的窗口中显示图像: 4 ...
- Altium Designer 10 | 常用库及部分元件名中英文对照表
———————————————————————————————————————————— 常用库及部分元件名中英文对照表 - - - - - - - - - - - - - - - - - - - - ...
随机推荐
- Java方法调用中的别名处理
将一个对象传递到方法内部时,也会产生别名现象.//: PassObject.java// Passing objects to methods can be a bit tricky62class L ...
- 新冲刺Sprint3(第六天)
一.Sprint介绍 商家功能模块继续完善着,加快了工作的步伐. 二.Sprint周期 看板: 燃尽图:
- 413 Request Entity Too Large
做小视频上传,结果接口总是返回500,服务器端跟踪,根本就进不来,再次翻查,发下服务器返回的其实是413,只不过APP底层接口将所有不是200的回包都转成500了,问题定位. 有了错误码,有了描述,字 ...
- 特别实用而且功能强大的attributedText属性
UILabel *sendNameLB = [[UILabel alloc]initWithFrame:CGRectMake(, , , )]; NSString * string = @" ...
- Json与javaBean之间的转换工具类
/** * Json与javaBean之间的转换工具类 * * {@code 现使用json-lib组件实现 * 需要 * json-lib-2.4-jdk15.jar * ...
- 运用CADisplayLink来开启定时器
CADisplayLink来开启定时器 CADisplayLink是以屏幕刷新频率将内容绘制到屏幕上的定时器,每秒60Hz.使用的时候,先创建一个CADisplayLink对象,将其添加到一个RunL ...
- 转载《Android-TabHost 选项卡功能用法详解》
一. TabHost介绍 TabHost组件可以在界面中存放多个选项卡, 很多软件都使用了改组件进行设计; 1. TabHost常用组件 TabWidget : 该组件就是TabHost标签页中上部 ...
- coderforces #387 Servers(模拟)
Servers time limit per test 2 seconds memory limit per test 256 megabytes input standard input outpu ...
- python未知网卡名情况下获取本机IP
import socket def get_ip(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: # doesn't even ...
- UVA 572 (dfs)
题意:找出一块地有多少油田.'@'表示油田.找到一块就全部标记. #include<cstdio> #define maxn 110 char s[maxn][maxn]; int n,m ...