#include <iostream> #include <string> class colors { public: int color = '1'; }; class shades: public colors { public: int color = '2'; }; int main() { shades w; shades b; cout<< w.color; }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:17:1: error: ‘cout’ was not declared in this scope cout<< w.color; ^~~~ prog.cpp:17:1: note: suggested alternative: In file included from prog.cpp:1:0: /usr/include/c++/6/iostream:61:18: note: ‘std::cout’ extern ostream cout; /// Linked to standard output ^~~~
Standard output is empty