I'm trying to convert string like "1234" into a single integer like, n = 1234;
I'm using for loop for this but its saving the ASCII values instead of the actual values
below is the code
#include<stdio.h>
main()
{
char lc[] = "12345";
int i,n;
p = lc;
for(i=0;i<5;i++)
{
n = lc[i];
printf("%d\n",n);
}
}
what am I missing ??