#include <animal.h>
main()
{
Animal myAnimal;
myAnimal = AnimalNew();
if (_somCheckVersion(_Animal, 0, 0))
somPrintf("Animal IS compatible with 0.0\n");
else
somPrintf("Animal IS NOT compatible with 0.0\n");
if (_somCheckVersion(_Animal, 1, 1))
somPrintf("Animal IS compatible with 1.1\n");
else
somPrintf("Animal IS NOT compatible with 1.1\n";
_somFree(myAnimal);
}
Assuming that the implementation of Animal is version 1.0, this program produces the following output:
Animal IS compatible with 0.0 Animal IS NOT compatible with 1.1