https://rentry.org/PPP2_p263 ⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18// Code derived from Stroustrup's PPP2 book // § 8.2.3 Default initialization // -and beginning on p 263 #include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<string> v; string s; while (cin >> s) v.push_back(s); } build & run: g++ -std=c++20 -O2 -Wall -pedantic ./ch_08/main_p263.cpp && ./a.out sauce: Bjarne Stroustrup's PPP2 textbook /robowaifu/'s official C++ learning textbook thread Prev • Up • Next