if you really want to do it without vectors ( you should use vectors, but anyway.. ) you have to get your types right:
string*: pointer to string (can be several strings next to each other), string&: reference to single string.
#include <string>
using namespace std;
// return type is "pointer to string", not "reference to string"
string* parse(string str,int from){
string *data=new string[6];
return data; // do not apply the *-operator here.
}
int main(){
string* data; // don't mention the size here. ( probably the error you got. )
data=parse("hmm..",18); // assign the result ( pointer ) to data
delete[] data; // don't leak memory
}
however i suggest you read up on pointers, references and what happens when you apply the *-operator. string * does not just mean "array of strings"