當前位置:首頁 » 編程語言 » 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

熱點內容
編程c語言初級教程 發布:2025-07-01 11:35:08 瀏覽:134
資料庫job 發布:2025-07-01 11:24:51 瀏覽:616
怎麼查微信訪問記錄 發布:2025-07-01 11:14:34 瀏覽:125
css3源碼 發布:2025-07-01 11:14:33 瀏覽:332
android訪問本機 發布:2025-07-01 10:56:06 瀏覽:412
伺服器改id是什麼 發布:2025-07-01 10:30:03 瀏覽:612
php微信開發教程 發布:2025-07-01 10:28:24 瀏覽:843
訪問學者聯系導師 發布:2025-07-01 10:27:44 瀏覽:985
伺服器端的http地址 發布:2025-07-01 10:04:35 瀏覽:178
php好處 發布:2025-07-01 10:01:45 瀏覽:879