Using dynamic_cast in c++ : <p>I have 4 classes in c++ . Animal is the super class were Snake and Tiger inherit from Animal but also inherit from Dangerous Animal . I have implemented a function to check if Snake or tiger is an instance of DangerousAnimal . However I am finding problems in implemting it in c++</p>

<p>my code is :</p>

<pre><code>bool Vet::examine (Animal *someAnimal){

        if(DangerousAnimal* s = dynamic_cast&lt;DangerousAnimal*&gt;(Animal)){
            return false;
        }else{
            return true;
        }
    }
</code></pre>

<p>The error is </p>

<pre><code>dillu24@dillu24-VirtualBox:~/Desktop/OOP/Lab1$ g++ -std=c++11 -oAnimalWellBeingLauncher AnimalWellBeingLauncher.cpp q1.cpp
q1.cpp: In member function ‘bool Vet::examine(Animal*)’:
q1.cpp:122:64: error: expected primary-expression before ‘)’ token
   if(DangerousAnimal* s = dynamic_cast&lt;DangerousAnimal*&gt;(Animal)){
</code></pre>
