Why do you create a program that executes
gcc to create another program?
Just create your
maypwd program and compile and link it using
gcc.
The assignment requires that your program did not use the
system()
function (
system(3) - Linux manual page[
^]) to execute a shell built-in command.
So you have to look for C standard library function that returns the name of the current / working directory:
getcwd(3) - Linux manual page[
^].