How can I store the value pointed by the char pointer into an integer variable? I have the following code:
main ()
{
int i;
char *tmp = "10";
i = (int)tmp;
printf("value of i is %d",i);
}
Is my code most efficient for the given task? I am using Visual Studio 2008.