當前位置:首頁 » 編程語言 » 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-10-17 11:53:05 瀏覽:883
安卓10與安卓11哪個用戶多 發布:2025-10-17 11:44:29 瀏覽:999
管理雲存儲空間日歷刪除 發布:2025-10-17 11:42:08 瀏覽:600
三合一網站源碼 發布:2025-10-17 11:30:26 瀏覽:613
前置伺服器地址 發布:2025-10-17 11:23:40 瀏覽:390
宏編程器 發布:2025-10-17 11:17:57 瀏覽:244
陌陌清除訪問腳印 發布:2025-10-17 11:11:20 瀏覽:785
聯想伺服器如何開機步驟 發布:2025-10-17 10:36:06 瀏覽:609
數據結構與演算法分析c語言描述pdf 發布:2025-10-17 10:35:28 瀏覽:36
安卓推廣效果統計是什麼 發布:2025-10-17 10:31:11 瀏覽:435