Errors in program

sir, can u plss explain explain me the reasons of error and how can i solve these…
code: https://ide.codingblocks.com/s/435658

hello @aman17nov1999

pls share the question link with me

sir , there are error in program related to constructor and in function. Just i want to know about the errors , I dont want solution for the question.
Still i m writing down the whole question:
Given a list of processes where each process have a unique id and a unique parent id . Parent id is the id of the process that initiated that process . You want to kill a particular process given by an integer kill . Print id of all the processes that will be killed to kill that process.You should print them in sorted order by id.
In order to kill a process , all its child processes should be killed as well . Also, only one process have parent id as 0 ie. that process started itself.

@aman17nov1999

u have defined function inside another function thats why it is giving error.

remove add edge function from the constructor
and declare it outside of constructor.

also all ur variables that u have to use later in any other functions , declare them as member variable otherwise u will not be able to access it later .

Sir, can u ammend the code and send.

i would suggest u to revise ur oops and stl concepts , u are commiting too many mistakes in such topics.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.