c++ - How to get full path by just giving filename? -


please not getting how implement function returns full path of file using c/c++?

unix/linux:

#include <limits.h> #include <stdlib.h>  char *full_path = realpath("foo.dat", null);  ...  free(full_path); 

or:

char full_path[path_max]; realpath("foo.dat", full_path); 

windows:

#include <windows.h>  tchar full_path[max_path];  getfullpathname(_t("foo.dat"), max_path, full_path, null); 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -