How to get the absolute path for a given relative path programmatically in Linux?
Incase of Windows we have the _fullpath() API. In other words, I mean
_fullpath()
Check out the realpath function.
#include #include #include int main() { char resolved_path[PATH_MAX]; realpath("../../", resolved_path); printf("\n%s\n",resolved_path); return 0; }