How can I convert char a[0] into int b[0] where b is a empty dynamically allocated int array
I have tried
char a[] = \"4x^0\"; int *b; b = new int[10
The atoi() version isn't working because atoi() operates on strings, not individual characters. So this would work:
char a[] = "4"; b[0] = atoi(a);
Note that you may be tempted to do: atoi(&temp) but this would not work, as &temp doesn't point to a null-terminated string.