Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 10
There is a space after test2 and test3 in lines 36,37,40,41 in your code.
Animal test2;
test2.identity="lion";
// remove space after test2. The dot(.) should be immediately after test2. Same in the other three lines
test2.name();
Animal test3;
test3.sound="roar";
test3.callsound();
After removing the spaces, the program works.