prog.cpp: In function ‘int main()’:
prog.cpp:23:8: error: cannot bind ‘std::ostream {aka std::basic_ostream<char>}’ lvalue to ‘std::basic_ostream<char>&&’
cout<<*pc1<<endl<<endl;
^
In file included from /usr/include/c++/4.8/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/4.8/ostream:602:5: error: initializing argument 1 of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = car]’
operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
^
prog.cpp:25:9: error: ‘pc2’ was not declared in this scope
cout<<(*pc2).weight<<" "<<pc2->color<<endl;
^
prog.cpp:26:9: error: ‘pc3’ was not declared in this scope
cout<<(*pc3).weight<<" "<<pc3->color<<endl;
^