Do you guys have any hint what's wrong with my code? I've made it as simple as possible and tried to search all over google but still have no idea.
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
class Animal {
public:
Animal();
Animal(string _sound) :
sound(_sound) {}
virtual ~Animal();
void give_sound() {
cout << sound << " ";
}
protected:
string sound;
};
class Dog : protected Animal {
public:
Dog(): Animal("woof") {}
};
int main() {
Dog doggy();
doggy.give_sound(); // expression must have class type
return 0;
}