You have to figure out some sort of system, so your program can tell how many elements it has to store in each dimension. For example, the .txt file where you save the data could look like this:
5 9 3
1901
1920
1918
3021
3078
3034
...
Here, we store threedimensional array into a file. The size of the array is not know, so first, we print the number of elements. In this case, the array is [5][9][3]. Then we can allocate that memory/declare the nessesary vectors and find some way to store the data in them.
The datafile can look complelty different: it's just how you designe it.
i just didnt understand!
i have a class named project in which there is a data of type vector<vector<vector<string>>> and i have chosen type vector because i dont know anything about the size. and the data in this type is going to be a set of tables, and i want to save this set of tables! what must i do now?
You can use special font for code with the code-tag (#format on the right when posting).
Oke, so you got a unknown number of tables, and each table has an unknown x and y size. On the first line, I would print the number of tables. Then the x and y size from the first table. Then the first table. Then the x and y size from the second table, etc. etc.
You can create your own structure in the file, as long as you keep to that structure when writing to and reading from the file.