XINU
lib
atol.c
Go to the documentation of this file.
1
19
long
atol
(
char
*p)
20
{
21
long
n;
22
int
f;
23
24
n = 0;
25
f = 0;
26
for
(;; p++)
27
{
28
switch
(*p)
29
{
30
case
' '
:
31
case
'\t'
:
32
continue
;
33
case
'-'
:
34
f++;
35
case
'+'
:
36
p++;
37
}
38
break
;
39
}
40
while
(*p >=
'0'
&& *p <=
'9'
)
41
{
42
n = n * 10 + *p++ -
'0'
;
43
}
44
return
(f ? -n : n);
45
}
atol
long atol(char *p)
ASCII文字列をlong型に変換する。
Definition:
atol.c:19
Generated by
1.8.13