
Originally Posted by
grayfox
error: C2228: left of '.nospace' must have class/struct/union
You should know that: std::endl is just a template function
declaration:
template <class charT, class traits>
basic_ostream<charT,traits>& endl ( basic_ostream<charT,traits>& os );
template <class charT, class traits>
basic_ostream<charT,traits>& endl ( basic_ostream<charT,traits>& os );
To copy to clipboard, switch view to plain text mode
and following code is equal:
std::cout<<"hello"<<std::endl;
std::endl(std::cout<<"hello");
std::cout<<"hello"<<std::endl;
std::endl(std::cout<<"hello");
To copy to clipboard, switch view to plain text mode
Bookmarks