Added for cycle showing polymorphism

This commit is contained in:
Kolan Sh 2012-04-30 19:32:41 +04:00
parent ff5b65d70a
commit 85e4dfa13d
1 changed files with 5 additions and 2 deletions

7
main.c
View File

@ -33,13 +33,16 @@ int main (int argc, char *argv[])
((Square *) fig[i])->vtable->diag_length (fig[i]));
puts ("---\n");
}
/*goto end;
err:
end:*/
fig[0]->vtable->destroy (fig[0]);
fig[1]->vtable->destroy (fig[1]);
for (i = 0; i < sizeof (fig) / sizeof (Figure *); i++)
{
fig[i]->vtable->destroy (fig[i]);
}
return 0;
}