Add strings from .txt file to Array

I got a error, if you can help me to fix it :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  #include <iostream>
  #include <fstream>

  using namespace std;

  int main(){
    ifstream render("file1.txt");
    string arrayStrings[0];
    if(render.is_open()){
        render >> arrayStrings[1];
        render >> arrayStrings[2];
        
        cout << "Suma a i b su: " << arrayStrings[1] << " " << arrayStrings[2] << endl;
    } else cout << "Greska pri obradi\n";
    render.close();
    
    system("pause >nul");
    return 0;
  }
Last edited on
line 8.
I know, error is in line 8, but what to do?
why do you make a fixed sized array of size 0 ???
Topic archived. No new replies allowed.