Greetings all

I have a QString array stored on the heap and I would like to cast it into a std::string array and then pass it into a method within a different class.

I have tried the standard way:

Qt Code:
  1. QString * arrayPointer;
  2. arrayPointer = new QString [dynamicSize];
  3.  
  4. ExternalClass test;
  5. test.externalMethod(arrayPointer.toStdString());
To copy to clipboard, switch view to plain text mode 

This causes the compiler to chock. How do I correctly cast a QString pointer to a std::string pointer?

Many thanks for your help.