As an asigment i have to print out the code of my program into the terminal using the cat command. I have understood that I need to use some variation of the execl function to achieve that but what is bothering me is that to do that I need to know the path of my file which could change, so i was wondering if there is a way to find the path of the file inside the program.
I tried running the pwd command to find my current path but i couldnt get it to store the result in a variable and i dont know why execl("/bin/pwd", "pwd", NULL);
.