https://rentry.org/PPP2_p153a ⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16// Code derived from Stroustrup's PPP2 book // § 5.6.4 Narrowing errors // -and beginning on p 153 #include <iostream> using std::cout; int main() { int x = 2.9; char c = 1066; cout << x << '\n' // << c << '\n'; } build & run: g++ -std=c++20 -O2 -Wall -pedantic ./ch_05/main_p153a.cpp && ./a.out sauce: Bjarne Stroustrup's PPP2 textbook /robowaifu/'s official C++ learning textbook thread Prev • Up • Next