當前位置:首頁 » 編程語言 » 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-04-30 19:48:21 瀏覽:60
java文件上傳伺服器 發布:2025-04-30 19:01:09 瀏覽:693
編程課活動 發布:2025-04-30 18:49:06 瀏覽:157
如何發布axure伺服器 發布:2025-04-30 18:23:05 瀏覽:14
模擬器腳本製作 發布:2025-04-30 17:59:23 瀏覽:834
天翼雲電腦pc版不顯示伺服器 發布:2025-04-30 17:32:32 瀏覽:598
psp存儲卡是否原裝 發布:2025-04-30 17:12:44 瀏覽:561
java的jdk64下載 發布:2025-04-30 17:05:14 瀏覽:694
java培訓機構那家好 發布:2025-04-30 16:45:02 瀏覽:667
前端緩存資料庫 發布:2025-04-30 16:38:59 瀏覽:916