I've got a data file where each row has a float with two decimal precision, where each row represents a month, and there are 28 years worth of data. I'm trying to read in each line, and then store each line in an array. Then, using user input, store the data for a specific year inside a smaller array.
I can tell you what the problem is - cin.getline() takes a char* (C-string) and you are passing alldata[i], which is just a single character. Personally, I would read each bit of data into a string (to avoid the work of C-strings) and parse it into floats that way.
Okay, I made all data an array of characters, and used atof to convert it back to a float, but now it the program returns a constant value of 3.4e+02 for all 12 data points.