當前位置:首頁 » 編程語言 » 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 03:47:17 瀏覽:177
特產網源碼 發布:2025-09-16 03:42:24 瀏覽:327
安卓faceplay怎麼付款 發布:2025-09-16 03:32:34 瀏覽:582
安卓rom包里有什麼 發布:2025-09-16 03:07:57 瀏覽:351
sql2005無法連接 發布:2025-09-16 03:04:21 瀏覽:680
預埋件演算法 發布:2025-09-16 02:55:45 瀏覽:91
php取差集 發布:2025-09-16 02:46:58 瀏覽:972
ah腳本掃貨 發布:2025-09-16 02:44:53 瀏覽:71
加密相冊在哪裡找到 發布:2025-09-16 02:37:30 瀏覽:632
我的世界公益伺服器 發布:2025-09-16 02:26:18 瀏覽:833