#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char *p, *s;
long li;
s = "20y";
li = strtol(s,&p,0);
li = strtol(s,NULL,10); /* assigns 20 to li */
printf("%s in Base 10: %ld\n", s,li);
li = strtol(s,NULL,8); /* assigns 16 to li */
printf("%s in Base 8: %ld\n",s,li);
return 0;
}