I'm using g++ as the compiler and I'm trying to make a dog object and have it "bark".
I get this error: explicit qualification in declaration of 'void Bark()'
Here's the code:
How can I fix the problem?Code:#include <iostream> class Dog { public: void Bark(); }; void::Bark() { std::cout << "Bark!\n"; } int main() { Dog Shasta; system("CLS"); std::cout << "Here is a dog! It's name is Shasta! Listen to it bark!\n\n"; Shasta.Bark(); std::cout << " "; Shasta.Bark(); return 0; }