how can i use cin.getline function to display an array whose size is not determined and it is dynamically allocated in the memory. little helpline will be highly appreciated.
std::vector<std::string> lines;
for (std::string line; std::getline(std::cin, line); lines.push_back(line));
for (constauto& line : lines)
std::cout << line << '\n'