We were given an assignment that involved taking information from a file and storing the data in an array. The data in the file is sorted as follows
New York 40 43 N 74 01 W
the first 20 characters are the name of the city followed by the latitude and longitude. latitude and longitude should be easy with a few
fscanf(infile, "%d(
or %c
depending on which one i'm getting)", pointer)
operations so they won't be a problem.
My problem is that i do not know how to collect the string for the name of the city because some of the city names have spaces. I read something about using delimiters but from what i read, it seems like that is used more for reading an entire line. Is there any way to read the city name from a file and store the entire name with spaces in a character array? Thanks.