Geetha Choudary -2 Newbie Poster

explain what is the use of vector , lines.size and lines.push_back functions

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std ;

int main()
{
   ifstream file( __FILE__ ) ;
   string line ;
   vector<string> lines ;
   while( getline( file, line ) ) lines.push_back( line ) ;
   cout << "#lines: " << lines.size() << '\n' ;
}
Dave Sinkula commented: How about this: try thinking. Post your attempt. -2