I am a newbie using C++ and I am presently working on with files. I know how to read files which are in the current working directory. In my program I will be reading files from different directories and hence I need to specify the file path each time I am accesing that file. I need a sample code which will help me to read .csv files which are tokenized using strtok() function. Can yop please let me know how to specify the paths for the files that I am reading.
You can give the file name (including path) as input to fstream constructor or fstream open method, or stdio open method or whichever file opening method you are using. On windows, you can give, for example,
f.open("C:\\example.csv"); // two back slashes, one to escape the next backslash
Hope that helps.