How to solve these errors

@gagz23 make your comp as struct like this
pq

and the place where you are printing pq.top(), since pq contain an struct which has name and age you can’t directly print it. instead call pq.top().age or pq.top().name or store pq.top() in a number struct variable and then print required answer.

in the image i have posted above please return answer according to you and return something for every case,in your code you have taken only two cases and not returning anything if both cases fails.