Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<std::string> strings;
- {
- std::ifstream input_file("tekst.txt");
- std::string s;
- while (std::getline(input_file,s))
- strings.push_back(s);
- }
- std::cout << "Plik zawiera liczbe linii rowna: " << strings.size() << std::endl;
- for (std::vector<std::string>::size_type i{}; i<strings.size(); ++i)
- std::cout << i+1 << ". " << strings[i] << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement