I've got a char[] pointer:
How do I convert the "43" to an integer 43?
I need x to equal the integer that the string represents.
I keep getting the location or the ascii value or some other number that doesn't make sense to me.
I've tried every use of * that I could think of.
Code:int main(int argc, char *argv[]) { int i=0; int x; char *token[4]; token[0] = "43"; token[1] = "72"; token[2] = "17"; token[3] = "9"; for(i=0;i<4;i++) { x = (int)(*token)[i]; printf("\n%d", x); } return 0; }