I'm trying to figure out how to get text from a file, but the user inputs the file name so they can change which file they can use. I wrote a short little code that should at least output the first word of the file, but nothing. I'm new to using files in programming so any help would be great!
I'm using a .txt file with made up stock information on it:
FedEx Corp (FDX)
112.57 .53 100
113.77 1.5 75
So I looked around for the directory and found it. I'm using Xcode to write the program and its default directory is really really buried. I changed the directory to a folder I made in the project fold, but it still doesn't work. Any ideas?
is there a way to choose a new path where the .txt file comes from?
I don't know where the command line is, but I did finally found where the directory is (Xcode/DerivedData/NAME_OF_PROJECT/Build/Products/Debug/) and put my file in there and it works! Thanks for the help. :)