Structures which have a common basic structure but perform different functions are called homologous structures. E.g. forelimbs of reptiles, amphibians and mammals. Yes, they have a common ancestor but variously modified to carry out different activities.