CPP:Binary tree to doubly linked list

the code explained in the launchpad course video is not working please help!!