[ create a new paste ] login | about

Link: http://codepad.org/GgqDrnME    [ raw code | output | fork ]

slevy1ster - C, pasted on Jan 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
    char *p, *s;
    long li;

    s = "2a4";
li = strtol(s,NULL,8);   
printf("%s in Base 8: %ld\n",s,li);
return 0;
}


Output:
1
2a4 in Base 8: 2


Create a new paste based on this one


Comments: