#include <array>
#include <sstream>
#include <string>
#include <vector>
#include <iostream>
static std::istringstream testfile
{
"15101049 PRIYESH DAMOR p.damor\n"
"15101061 SIMRAN SONI simran.soni\n"
"15101012 KAUTAV BASUMATARY b.kaustav\n"
"15101053 RAHUL KUMAR rahul053\n"
"15101028 DUDDU VARA vara\n"
};
auto load(std::istream& is)
{
std::vector<std::array<std::string,4>> lines;
std::array<std::string,4> line;
while(is>>line[0]>>line[1]>>line[2]>>line[3])
{
lines.push_back(line);
}
return lines;
}
int main()
{
auto lines = load(testfile); // easily replaced by a std::ifstream
std::cout << "number of lines = " << lines.size() << "\n";
for(const auto& line : lines)
{
std::cout << line[0] << " " << line[1] << " " << line[2] << " " << line[3] << "\n";
}
return 0;
}