Read CSV file into Vectors

I have a CSV file that is formatted in the following way. The top row contains headers and the data is below. I have opened the file (sec2011) in Numbers on Mac and saved it as a csv. I would like to read each of the columns into a vector, but I can not get the code to even open the file.

secid,date,low,high,close,volume,return,cfadj,open,cfret,shrout
101310,03JAN2011,181.21,186,184.22,5331413,0.023444,12,181.37,12,448837
101310,04JAN2011,183.78,187.6995,185.01,5033144,0.004288,12,186.15,12,448837

ifstream infile("sec2011.csv");
if (!infile) {
cerr << "Couldn't open file!"<<endl;
return 1;

This code always returns the Couldn't open File text.

What am I doing wrong. I know the above code doesn't put the data into vectors, but I can't even get the file to read. Please help!

Thank you
Where is that file? Is it in the current working directory of the program?
Yes. I put the full path to the file and now it reads it. I still need some help reading the columns into vectors though.
Topic archived. No new replies allowed.