I have a text which consists of several paragraphs in which each paragraph consists of several lines. I have the number of paragraphs and now I want to store the number of lines in each paragraph in a vector.This is what I've written and doesn't work properly:
additionally,a paragraph is separated from the next with an empty line.
vector <int> line(){
ifstream ff("A.txt");
string ss;
int Y=0;
int s=NumerOfParagraphs();
vector<int> v;
while (getline (ff,ss)){
for (int i=0;i<s;i++){
if (ss!=""){
Y++;
}
else {
v[i]=Y;
Y=0;
}
}
}
return v;
}