Message from C, C++ discussions

January 2020

— So? Not everything in program goes in cout

— 

Cout will copy the content of a variable into the stream and then the stream will feed it to the stdout

Can you describe stringstream in those terms for me?

— Base nbj = obj;

This is not copy assignment?

— Sstream copies variables to internal string and returns a copy of it when one calls str()

— It is copy construction, not assignment

— And the return of str() is string?

— Https://en.cppreference.com/w/cpp/io/basic_stringstream/str

— Yes

— Https://en.cppreference.com/w/cpp/language/copy_assignment

— I know what assignment is bro. This T val = init; is copy construction

— Note T. You create a variable

— Https://www.geeksforgeeks.org/copy-constructor-vs-assignment-operator-in-c/