函式名: atol
功 能: 把字元串轉換成長整型數
用 法: long atol(const char *nptr);
基本介紹
函式簡介
程式舉例
程式例1
#include <stdio.h>int main(void){ long l; char *str = "98765432"; l = atol(str); /* 原來為l = atol(str); */ printf("string = %s integer = %ld\n", str, l); return(0);}
程式例2
#include<stdlib.h>main(){ char a[]=”1000000000”; char b[]=” 234567890”; long c; c=atol(a)+atol(b); printf(“c=%d\n”,c);}
相關釋義
- ATOL為消費者提供了哪些保護
- ATOL為哪位消費者提供了保護
- 誰為消費者提供了保護(一般為代理商,並附其公司名稱和ATOL號碼)