Pterosaurs and dinosaurs share a common ancestor that lived 230 million years ago. After that, the species split into two groups that evolved along different pathways. The pterosaurs went on to inhabit every continent on Earth. (Antarctica was a lot warmer back then.) They lived for about 150 million years, then went extinct alongside the dinosaurs.
The feathered fowl that fill our skies today evolved from dinosaurs, long after the pterosaurs and dinosaurs had branched off and gone their separate ways. Birds and pterosaurs are related, but distantly. They're more like third cousins than a parent and child.
Birds, bats, and pterosaurs all evolved to fly independently, but pterosaurs were the first vertebrates to do so. Like birds, their bones are hollow and light. But unlike a bird wing, a pterosaur wings consists of a flap of skin suspended from its arm and freakishly long fourth finger.