diff --git a/3-Operators/3-Stream.ipynb b/3-Operators/3-Stream.ipynb index 1637a987587420c8ea6f11269e9d8f943ce55c76..a1755df4afc5afcddd6e4f33a871a720cdd20991 100644 --- a/3-Operators/3-Stream.ipynb +++ b/3-Operators/3-Stream.ipynb @@ -190,8 +190,7 @@ "std::istream& operator>>(std::istream& in, Rational& r)\n", "{\n", " int numerator {}, denominator {};\n", - " in >> numerator;\n", - " in >> denominator;\n", + " in >> numerator >> denominator; // Notice the operator>> chained call\n", " \n", " if (!in)\n", " {\n", @@ -208,12 +207,8 @@ "\n", "int main()\n", "{\n", - " Rational r1(22, 7);\n", - " Rational r2(77, 17);\n", - " std::cout << \"Rational = \" << r1 << std::endl;\n", - " \n", - " std::cout << \"Call may also be chained due to the signature of the function: \" << r1 << \" and \" << r2 << std::endl;\n", - " \n", + " Rational r1(0,0);\n", + "\n", " std::cout << \"Enter a rational by separating calls by a space\" << std::endl;\n", " \n", " std::cin >> r1;\n",