Is it possible to change the place value of a value in an array. I have a char array and i want to turn it into a double array and another char array. One is for numbers the other is for operators. Unfortunately the char array only records single numbers like 5 intead of 55.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#headers and stuff
main int()
{
char text_analyzer[i]={5,5, ,5,}
double numbers[100]; //recording and editing digits
for (int i = 0; i < counter; i++)
{
if(isdigit(text_analyzer[i])) //checks if it's a digit
{
numbers[i] = text_analyzer[i];
cout << numbers[i];
}
return 0;
}
I dont quite understand your question, but you can convert char into double using the function "atof" - http://www.cplusplus.com/reference/cstdlib/atof/ not sure if this is something you want.