I am reading numbers from a text file. I was under the assumption that the text file needed to be saved in the same location as my cpp. file. Nothing is read from the file and when i attempt to debug, it looks like garbage in the variables. I have looked and looked and i can not understand where i need to store this txt file so that it is found and read. I have found that it needs to be stored in the same directory as the compiler, but i am unsure what that means. I am already one week late with this assignment as i am trying hard to finish it on my own, I really need some help.
The input file needs to be placed in the 'working directory', but the default working directory can vary depending on your IDE.
You can always specify the full path to the file, then it does not matter where it is placed. Beware: on Windows, it is better to use the forward slash instead of backslash to separate directories.
Great. Putting in the full path helped. I can read the numbers. Thank you guys.
Now if i could only figure out passing arrays in functions and how to write a proper function call.