I know there are several C++ ways to load in values from a CSV, but I'm curious, how can I adapt this incorrect approach with the minimal changes necessary to make it work:
std::ifstream fileStream ("File.txt"); // File.txt reads "1,2,3"
short numbers[3];
for (short i = 0; i < 3; ++i)
fileStream >> numbers[i];
Is there any way that I can do this using ifstream::operator>>, while keeping as conceptually close as possible to this implementation? Fix this code! :-)
Thanks! Believe it or not, this will be very helpful in a computational neutrino physics project I'm working on.