//#include <cstdlib> // for the definition of EXIT_FAILURE
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
// Associate stream objects with external file names
int main() {
//*** Reading from a file ***/
string line;
ifstream myfilein; // myfilein is an input stream
myfilein.open("test.txt"); // connect myfilein to file Input File
if (myfilein.is_open())
{
while (getline(myfilein, line, ','))
{
cout << line << '\n';
}
myfilein.close(); // close output file stream
}
return 0; // successful return
}
1,2,3,4,5