Input from csv file to C++

Pages: 12
Or even like:

1
2
3
4
5
6
7
8
9
long trash; // Used to ignore the first entry.
char comma;  // Used to retrieve and discard that pesky comma.
size_t i = 0;
const size_t Array_size = 100;
long array[Array_size];

while( i < Array_size && cin >> trash >> comma >> value[i++])
{ /* Blank body */ }


There are many many different ways of accomplishing your objectives. I suggest you Google "C++ file input and output" and start reading.

Read what the ignore() does.
Topic archived. No new replies allowed.
Pages: 12