當前位置:首頁 » 編程語言 » 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-03-26 00:10:03 瀏覽:399
相冊編程代碼 發布:2025-03-25 23:59:07 瀏覽:739
絕地求生安卓登不進去怎麼辦 發布:2025-03-25 23:58:58 瀏覽:861
西門子web伺服器是什麼作用 發布:2025-03-25 23:57:21 瀏覽:332
貨物編程軟體 發布:2025-03-25 23:51:33 瀏覽:93
ip限制訪問aspnet 發布:2025-03-25 23:50:50 瀏覽:768
常見面試演算法題 發布:2025-03-25 23:46:25 瀏覽:861
伺服器防火牆怎麼屏蔽所有ip 發布:2025-03-25 23:39:46 瀏覽:715
韓順平滿漢樓源碼 發布:2025-03-25 23:32:11 瀏覽:498
非同步編程語言 發布:2025-03-25 23:32:09 瀏覽:309