如何返回字符串数组?

Tom*_*ski 2 c++ arrays string return

我有功能:

int read_file() {
  ifstream file("plik");
  if(!file.is_open()) {
    throw -1;
  }
  int i = 0;
  string line[MAXSIZE];
  while(getline(plik, line[i])) {
    cout<<line[i]<<endl;
    i++;
  }

  return i; 
}
Run Code Online (Sandbox Code Playgroud)

但我想返回字符串数组:

line[]

我怎样才能做到这一点?

Lig*_*ica 14

别.数组不可复制.

std::vector<std::string>改用.