I made some mistakes in my original code, the testVar is actually a Long var, the " are not in the original code. So:
Long testVar = 125 // The longitude is variable
I understand 125 is not long, but this is only an example, thats why i wrote "The longitude is variable", some times it could be 125 and sometimes a greater value like 1245675753.
I know i can just simply char testVar[] = "125"; but the thing is I cant assign the value, the variable is already created, so I need to convert that long value to the ascii char array.
Can you please make an example? Since i was using this king of approach but I cant get it to work right:
Long testVar = 123456;
char _buffer[50];
sprintf(_buffer, "%d", testVar);
int test = _buffer[0] - 0; //this should print the ASCII equivalent of 1 but is printing something else