Nie wiem dlaczego obiekt **test **zwraca mi adres, a nie napis "BMW"
#include <iostream>
#include <fstream>
using namespace std;
static int object = 0;
class Pojazd {
public:
Pojazd() { object++; }
virtual void wypisz(ostream& out) = 0;
~Pojazd() { object--; }
};
class Bmw : public Pojazd {
protected:
string marka;
public:
Bmw() { object++; }
Bmw(const string& a1)
: marka(a1)
{
}
friend ostream& operator<<(ostream& out, const Bmw& ob)
{
return out << ob.marka;
}
~Bmw() { object--; }
};
int main()
{
Pojazd* test = new Bmw("BMW");
Bmw test2("BMW");
cout << test << endl;
cout << test2 << endl;
return 0;
}