Thanks guys, I figured out a bit different way to do it....now I have another problem...the file has character as well as numbers. The numbers could be anything from ints to floats. I only want to pick out these as I'm reading the file in. I know how to code it in C but I'm not sure how the c++ code would look like.
my c version:
this reads decimals only thought.
int main(int argc, char *argv)
int line, con1, con2, i;
if (argc != 2)
cout << "Commandline Error!";
ifstream examplefile(argv); //open a file indicated by the single command
if (! examplefile.is_open())
cout << "Error opening file"; exit (1);
cout << line << endl;
for (i=1; i<=line; i++)
sscanf(buffer, "%d, %d", &con1, &con2);
cout << con1 << "," << con2 << endl;