How to implement readlink to find the path
Using the readlink function used as a solution to How do I find the location of the executable in C? , how would I get the path into a char array? Also, what do the variables buf and bufsize represent and how do I initialize them? EDIT: I am trying to get the path of the currently running program, just like the question linked above. The answer to that question said to use readlink("proc/self/exe") . I do not know how to implement that into my program. I tried: char buf[1024]; string var = readlink("/proc/self/exe", buf, bufsize); This is obviously incorrect. This Use the readlink() function