relative path

In my code I have a line similar to this:

fopen("../textures/test.bmp")

This works if I run the program from its own directory, however it doesnt find the file if I run it from any other directory. How can I make sure the program finds files relative to its own directory rather than the one I'm running it from?
By using absolute path names.
fopen((programDirectory+"/../textures/test.bmp").c_str());
Easy as that huh? :p I thought I was doing something wrong. Thanks! :)
Topic archived. No new replies allowed.