當前位置:首頁 » 編程語言 » c語言字元串轉函數

c語言字元串轉函數

發布時間: 2025-03-24 05:17:03

c語言atoi用法介紹

函數名: atoi
功 能: 把字元串轉換成長整型數
用 法: #include <stdlib.h>
int atoi(const char *nptr);
程序例:
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
int n;
char *str = "1234";

n = atoi(str);
printf("string = %s integer = %d\n", str, n);
return 0;
}

運行結果是:
string =1234 integer=1234

熱點內容
檢測信號數據存儲 發布:2025-09-16 05:21:41 瀏覽:404
androiddagger2 發布:2025-09-16 04:38:38 瀏覽:123
javahttp編程 發布:2025-09-16 04:33:44 瀏覽:302
壓縮安裝器 發布:2025-09-16 03:47:17 瀏覽:181
特產網源碼 發布:2025-09-16 03:42:24 瀏覽:331
安卓faceplay怎麼付款 發布:2025-09-16 03:32:34 瀏覽:588
安卓rom包里有什麼 發布:2025-09-16 03:07:57 瀏覽:356
sql2005無法連接 發布:2025-09-16 03:04:21 瀏覽:684
預埋件演算法 發布:2025-09-16 02:55:45 瀏覽:94
php取差集 發布:2025-09-16 02:46:58 瀏覽:975