I have to copy characters of a file in a big size array, so I created this code:
std::vector<std::vector<char> > strings;
strings.resize(rows);
for (int i = 0; i < rows; i++)
{
strings[i].resize(columns);
}
ifstream in("filename.txt");
for (int i = 0; i < rows; i++)
in.getline(strings[i], columns);
strings
should contain all the characters of the file, but when I compile this program, I have the following error:
no matching function for call to ‘std::basic_ifstream >::getline(std::vector >&, int)’</p>
(and others error lines)
How can I copy all characters of a file in a big char array?