i wanted to practise some basic c++ stuff. I focused on inheritance just to experiment with that. Everything went well until i faced some strange problem: 'cout' was not declared in this scope. I have looked on some topics but on most of them the hints were like append library or write 'using namespace std' but it doesn't solve my problem.
#include <iostream>
class podst
{
public:
float a;
float b;
float dodaw();
podst(float c,float d) : a(c), b(d)
{
}
};
float podst::dodaw()
{
return (a+b);
}
class poch : public podst
{
poch() : podst(5,4)
{
cout << a << endl << b << dodaw() << endl;
}
};
using namespace std;
int main()
{
podst podst(1,2);
cout << podst.dodaw() << endl;
poch poch2;
return 0;
}