^ isn't a power operator, it means bitwise exclusive-OR. I don't think XOR was what you wanted, so look into the pow function from <cmath>.
Code:
#include <cmath>
std::pow(x, y); // x to the yth power
Code:
int list1[a.length()^2/2];
Keep in mind that this isn't standard C++. An array in C++ can only have a constant integral size; your size isn't constant, so the code may not work on other compilers. The standard way to do it is
Code:
int *list1 = new int[std::pow(a.length(), 2.0) / 2];
But then you need to remember to free the memory because it won't be released automatically.
Even better would be a standard vector object:
Code:
#include <vector>
std::vector<int> list1(std::pow(a.length(), 2.0) / 2);