Python has some nice features for working with paths:

Does anybody know of any C/C++ functions, techniques or libraries to do something similar?

For example, if I'm passed a path on the commandline as such:

x = "~/mystuff/../myfile.txt"

In python I could get the absolute path as such:

os.path.abspath( os.path.expanduser( x ) )

would return the following for a user called fred:


Any suggestions for an easy way to accomplish something similar in C/C++?