^ 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>.
std::pow(x, y); // x to the yth power
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
But then you need to remember to free the memory because it won't be released automatically.
int *list1 = new int[std::pow(a.length(), 2.0) / 2];
Even better would be a standard vector object:
std::vector<int> list1(std::pow(a.length(), 2.0) / 2);