1. 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>
//寬字元分類
標准
C/C++
(同上的不再注釋)
#include
<algorithm>
//STL
通用演算法
#include
<bitset>
//STL
位集容器
#include
<cctype>
#include
<cerrno>
#include
<clocale>
#include
<cmath>
#include
<complex>
//復數類
#include
<cstdio>
#include
<cstdlib>
#include
<cstring>
#include
<ctime>
#include
<deque>
//STL
雙端隊列容器
#include
<exception>
//異常處理類
#include
<fstream>
#include
<functional>
//STL
定義運算函數(代替運算符)
#include
<limits>
#include
<list>
//STL
線性列表容器
#include
<map>
//STL
映射容器
#include
<iomanip>
#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
<cwchar>
#include
<cwctype>
using
namespace
std;
C99
增加
#include
<complex.h>
//復數處理
#include
<fenv.h>
//浮點環境
#include
<inttypes.h>
//整數格式轉換
#include
<stdbool.h>
//布爾環境
#include
<stdint.h>
//整型環境
#include
<tgmath.h>
//通用類型數學宏

2. c語言 常用的有哪些函數呢

mail printf scanf

3. c語言常用函數有那些

函 數 功 能 函 數 功 能
sin(x) x為弧度 pow(x,y) 求xy
cos(x) sqrt(x) 求x的平方根
exp(x) 指數函數 ex fabs(x) 求x的絕對值
log(x) 自然對專數 ln x ceil(x) 求頂
log10(x) 常用屬對數 lg x floor(x) 求底

4. C語言常用詞彙及函數有那些

常用詞彙:

1、short:修飾,短整型數據,可省略被修飾的int。

2、long:修飾int,長整型數據,可省略被修飾的int。

3、long long:修飾int,超長整型數據,可省略被修飾的int。

4、signed:修飾整型數據,有符號數據類型。

5、unsigned:修飾整型數據,無符號數據類型。

6、restrict:用於限定和約束指針,並表明指針是訪問一個數據對象的唯一且初始的方式。

7、return:用在函數體中,返回特定值(如果是void類型,則不返回函數值)。

8、continue:結束當前循環,開始下一輪循環。

9、break:跳出當前循環或switch結構。

10、goto:無條件跳轉語句。

11、if:條件語句,後面不需要放分號。

12、else:條件語句否定分支(與if連用)。

13、switch:開關語句(多重分支語句)。

14、case:開關語句中的分支標記,與switch連用。

15、default:開關語句中的「其他」分支,可選。

常用函數:

1、int isalpha(int ch) 若ch是字母('A'-'Z','a'-'z'),返回非0值,否則返回0。

2、int isalnum(int ch) 若ch是字母('A'-'Z','a'-'z')或數字('0'-'9'),返回非0值,否則返回0。

3、int abs(int i) 返回整型參數i的絕對值。

4、double cabs(struct complex znum) 返回復數znum的絕對值。

5、double fabs(double x) 返回雙精度參數x的絕對值。

6、long labs(long n) 返回長整型參數n的絕對值。

5. c語言中有哪些函數

買本書看看吧,C語言經常使用函數有4百多個,都集合在某類的頭文件中。經常使用的有數學函數(38個),字元串函數(59個),輸入輸出函數(95個),內存相干函數(41個),文件函數(18個),目錄函數(22個),磁碟函數(4個),系統調用函數(67個),圖形函數(76個),日期時間函數(13個),數據結構函數(4個),還有其他的函數等等!

6. c語言常用庫函數有哪些

C語言的標來准庫函數有數百個,源分布在不同的庫文件中,目前絕大多數系統和程序肯定兼容的是C99標准,但2011年已經發布了更新的版本,有些遺留系統不一定支持最新的特性。
不同函數應用場合不一樣,說不說哪些更常用,就看你所做工作的性質了。
通常來說,至少在基礎編程時,stdio中的輸入輸出(可能是控制台的、也可能是文件的)、stdlib中的各種通用工具(如分配堆內存)、string中的字元串處理、time中的日期時間處理、math中的數學函數都算是比較常用的。

7. c語言常用函數

你說的那是數據結構吧
常用函數:
函數名: abs
功 能: 求整數的絕對值
用 法: int abs(int i);
程序例:
#include <stdio.h>
#include <math.h>

int main(void)
{
int number = -1234;

printf("number: %d absolute value: %d\n", number, abs(number));
return 0;
}
函數名: asctime
功 能: 轉換日期和時間為碼
用 法: char *asctime(const struct tm *tblock);
程序例:
#include <stdio.h>
#include <string.h>
#include <time.h>

int main(void)
{
struct tm t;
char str[80];

/* sample loading of tm structure */

t.tm_sec = 1; /* Seconds */
t.tm_min = 30; /* Minutes */
t.tm_hour = 9; /* Hour */
t.tm_mday = 22; /* Day of the Month */
t.tm_mon = 11; /* Month */
t.tm_year = 56; /* Year - does not include century */
t.tm_wday = 4; /* Day of the week */
t.tm_yday = 0; /* Does not show in asctime */
t.tm_isdst = 0; /* Is Daylight SavTime; does not show in asctime */

/* converts structure to null terminated
string */

strcpy(str, asctime(&t));
printf("%s\n", str);

return 0;
}
函數名: bar
功 能: 畫一個二維條形圖
用 法: void far bar(int left, int top, int right, int bottom);
程序例:

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy, i;

/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");

/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}

midx = getmaxx() / 2;
midy = getmaxy() / 2;

/* loop through the fill patterns */
for (i=SOLID_FILL; i<USER_FILL; i++)
{
/* set the fill style */
setfillstyle(i, getmaxcolor());

/* draw the bar */
bar(midx-50, midy-50, midx+50,
midy+50);

getch();
}

/* clean up */
closegraph();
return 0;
}
函數名: calloc
功 能: 分配主存儲器
用 法: void *calloc(size_t nelem, size_t elsize);
程序例:

#include <stdio.h>
#include <alloc.h>

int main(void)
{
char *str = NULL;

/* allocate memory for string */
str = calloc(10, sizeof(char));

/* "Hello" into string */
strcpy(str, "Hello");

/* display string */
printf("String is %s\n", str);

/* free memory */
free(str);

return 0;
}
函數名: clrscr
功 能: 清除文本模式窗口
用 法: void clrscr(void);
程序例:

#include <conio.h>

int main(void)
{
int i;

clrscr();
for (i = 0; i < 20; i++)
cprintf("%d\r\n", i);
cprintf("\r\nPress any key to clear screen");
getch();

clrscr();
cprintf("The screen has been cleared!");
getch();

return 0;
}
函數名: cprintf
功 能: 送格式化輸出至屏幕
用 法: int cprintf(const char *format[, argument, ...]);
程序例:

#include <conio.h>

int main(void)
{
/* clear the screen */
clrscr();

/* create a text window */
window(10, 10, 80, 25);

/* output some text in the window */
cprintf("Hello world\r\n");

/* wait for a key */
getch();
return 0;
}
太多了 自己下一個MyTC5.4.1裡面有教程

8. 求C語言編程中常用的函數

字元處理函數
本類別函數用於對單個字元進行處理,包括字元的類別測試和字元的大小寫轉換

頭文件 ctype.h

函數列表<>
函數類別 函數用途 詳細說明
字元測試 是否字母和數字 isalnum
是否字母 isalpha
是否控制字元 iscntrl
是否數字 isdigit
是否可顯示字元(除空格外) isgraph
是否可顯示字元(包括空格) isprint
是否既不是空格,又不是字母和數字的可顯示字元 ispunct
是否空格 isspace
是否大寫字母 isupper
是否16進制數字(0-9,A-F)字元 isxdigit
字元大小寫轉換函數 轉換為大寫字母 toupper
轉換為小寫字母 tolower

地區化
本類別的函數用於處理不同國家的語言差異。

頭文件 local.h

函數列表
函數類別 函數用途 詳細說明
地區控制 地區設置 setlocale
數字格式約定查詢 國家的貨幣、日期、時間等的格式轉換 localeconv

數學函數
本分類給出了各種數學計算函數,必須提醒的是ANSI C標准中的數據格式並不符合IEEE754標准,一些C語言編譯器卻遵循IEEE754(例如frinklin C51)

頭文件 math.h

函數列表
函數類別 函數用途 詳細說明
錯誤條件處理 定義域錯誤(函數的輸入參數值不在規定的范圍內)
值域錯誤(函數的返回值不在規定的范圍內)
三角函數 反餘弦 acos
反正弦 asin
反正切 atan
反正切2 atan2
餘弦 cos
正弦 sin
正切 tan
雙曲函數 雙曲餘弦 cosh
雙曲正弦 sinh
雙曲正切 tanh
指數和對數 指數函數 exp
指數分解函數 frexp
乘積指數函數 fdexp
自然對數 log
以10為底的對數 log10
浮點數分解函數 modf
冪函數 冪函數 pow
平方根函數 sqrt
整數截斷,絕對值和求余數函數 求下限接近整數 ceil
絕對值 fabs
求上限接近整數 floor
求余數 fmod

本分類函數用於實現在不同底函數之間直接跳轉代碼。 頭文件 setjmp.h io.h

函數列表
函數類別 函數用途 詳細說明
保存調用環境 setjmp
恢復調用環境 longjmp

信號處理
該分類函數用於處理那些在程序執行過程中發生例外的情況。

頭文件 signal.h

函數列表
函數類別 函數用途 詳細說明
指定信號處理函數 signal
發送信號 raise

可變參數處理
本類函數用於實現諸如printf,scanf等參數數量可變底函數。

頭文件 stdarg.h

函數列表
函數類別 函數用途 詳細說明
可變參數訪問宏 可變參數開始宏 va_start
可變參數結束宏 va_end
可變參數訪問宏 訪問下一個可變參數宏 va_arg

輸入輸出函數
該分類用於處理包括文件、控制台等各種輸入輸出設備,各種函數以「流」的方式實現

頭文件 stdio.h

函數列表
函數類別 函數用途 詳細說明
文件操作
刪除文件 remove
修改文件名稱 rename
生成臨時文件名稱 tmpfile
得到臨時文件路徑 tmpnam
文件訪問 關閉文件 fclose
刷新緩沖區 fflush
打開文件 fopen
將已存在的流指針和新文件連接 freopen
設置磁碟緩沖區 setbuf
設置磁碟緩沖區 setvbuf
格式化輸入與輸出函數 格式輸出 fprintf
格式輸入 fscanf
格式輸出(控制台) printf
格式輸入(控制台) scanf
格式輸出到緩沖區 sprintf
從緩沖區中按格式輸入 sscanf
格式化輸出 vfprintf
格式化輸出 vprintf
格式化輸出 vsprintf
字元輸入輸出函數 輸入一個字元 fgetc
字元串輸入 fgets
字元輸出 fputc
字元串輸出 fputs
字元輸入(控制台) getc
字元輸入(控制台) getchar
字元串輸入(控制台) gets
字元輸出(控制台) putc
字元輸出(控制台) putchar
字元串輸出(控制台) puts
字元輸出到流的頭部 ungetc
直接輸入輸出 直接流讀操作 fread
直接流寫操作 fwrite
文件定位函數 得到文件位置 fgetpos
文件位置移動 fseek
文件位置設置 fsetpos
得到文件位置 ftell
文件位置復零位 remind
錯誤處理函數 錯誤清除 clearerr
文件結尾判斷 feof
文件錯誤檢測 ferror
得到錯誤提示字元串 perror

實用工具函數
本分類給出了一些函數無法按以上分類,但又是編程所必須要的。

頭文件 stdlib.h

函數列表
函數類別 函數用途 詳細說明
字元串轉換函數 字元串轉換為整數 atoi
字元串轉換為長整數 atol
字元串轉換為浮點數 strtod
字元串轉換為長整數 strtol
字元串轉換為無符號長整型 strtoul
偽隨機序列產生函數 產生隨機數 rand
設置隨機函數的起動數值 srand
存儲管理函數 分配存儲器 calloc
釋放存儲器 free
存儲器分配 malloc
重新分配存儲器 realloc
環境通信 中止程序 abort
退出程序執行,並清除環境變數 atexit
退出程序執行 exit
讀取環境參數 getenv
程序掛起,臨時執行一個其他程序 system
搜索和排序工具 二分查找(數據必須已排序) bsearch
快速排序 qsort
整數運算函數 求絕對值 abs
div
得到除法運算底商和余數
求長整形底絕對值 labs
求長整形除法的商和余數 ldiv
多位元組字元函數 得到多位元組字元的位元組數 mblen
得到多位元組字元的位元組數 mbtowc
多位元組字元轉換 wctomb
多位元組字元的字元串操作 將多位元組串轉換為整數數組 mbstowcs
將多位元組串轉換為字元數組 mcstowbs

字元串處理
本分類的函數用於對字元串進行合並、比較等操作

頭文件 string.h

函數列表
函數類別 函數用途 詳細說明
字元串拷貝 塊拷貝(目的和源存儲區不可重疊) memcpy
塊拷貝(目的和源存儲區可重疊) memmove
串拷貝 strcpy
按長度的串拷貝 strncpy
字元串連接函數 串連接 strcat
按長度連接字元串 strncat
串比較函數 塊比較 memcmp
字元串比較 strcmp
字元串比較(用於非英文字元) strcoll
按長度對字元串比較 strncmp
字元串轉換 strxfrm
字元與字元串查找 字元查找 memchr
字元查找 strchr
字元串查找 strcspn
字元串查找 strpbrk
字元串查找 strspn
字元串查找 strstr
字元串分解 strtok
雜類函數 字元串設置 memset
錯誤字元串映射 strerror
求字元串長度 strlen

日期和時間函數
本類別給出時間和日期處理函數

頭文件 time.h

函數列表
函數類別 函數用途 詳細說明
時間操作函數 得到處理器時間 clock
得到時間差 difftime
設置時間 mktime
得到時間 time
時間轉換函數 得到以ASCII碼表示的時間 asctime
得到字元串表示的時間 ctime
得到指定格式的時間 strftime

函數庫未來的發展方向
本部分用於說明各類別函數庫在將來如何發展。

序號 庫類別 頭文件 詳細說明
1 錯誤處理 errno.h
2 字元處理 ctype.h
3 地區化 local.h
4 數學函數 math.h
5 信號處理 signal.h
6 輸入輸出 stdio.h
7 實用工具程序 stdlib.h
8 字元串處理 string.h

34

9. c語言中的幾個常用函數

what

10. C語言中常用的函數有那些

printf ,scanf,常用函數多了,看你編什麼了