I recently wrote a C++ program that opens a file and reads it. If I want to run the program in Unix/Linux and the file name and path will be a environment variable. How can I achieve it?
getenv(char const *name) of the
stdlib.h. Note, however, that environment variables are a quite unclean way to pass parameters.