标签:
#include <stdlib.h>
#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);
}
/*将字符串a与字符串b转换成数字后相加*/
#include<stdlib.h>
main()
{
char
a[]=”1000000000”;
char
b[]=” 234567890”;
long
c;
c=
atol
(a)+
atol
(b);
printf
(“c=%d\n”,c);
}
_variant_t vtSumCount = _bstr_t( "0" );
vtSumCount.ChangeType( VT_DECIMAL );
char cSumValue[16]={0};
strcpy(cSumValue, (LPCSTR)_bstr_t(vtSumCount));
int SumCount;
SumCount = atoi(cSumValue);
标签:
原文地址:http://www.cnblogs.com/rinack/p/4253260.html