but I want to copy elements in array o into another array. How can I do this given that o is of variable size?
To be more specific, my goal is to remove duplicate elements in an array. So, I could check if o[i] == o[i+1] and if so, o[i+1] would not be moved into the second array.
use std::vector<std::string> instead of string array if you can. Then you will know the total number of elements, find out duplicates and move them out. For moving can use std::move if you have a C++11 capable toolchain
Starting more than one thread on essentially same question is rude.
Deleting original question from the thread is rude.
You can perform the desired operation inplace in the array without additional containers.
std::string has copy assignment operator.
Your input array o has fixed size; not variable.