Added for cycle showing polymorphism
This commit is contained in:
parent
ff5b65d70a
commit
85e4dfa13d
7
main.c
7
main.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue