The file is of the following form:
word1
word2
word3
...
And I create vector of strings after reading those words from the file like this:
std::vector<string> words;
string w;
ifstream file("input");
while(getline(file,w))
words.push_back(w);
file.close();
Will the size of physical memory occupied by the vector be same as the size of input file? Why?
Aucun commentaire:
Enregistrer un commentaire