I have a program that needs to perform the same function on several .csv files. My question is if there is any way to replace just the file name in the ifstream function, and possibly run this as a loop, or something of that nature. I have tried several different ways of doing this to no avail.
Thanks.
int symbol::parseCSV(double *ptr)
{
int k=0;
string quote;
size_t length;
double sum=0,avg;
char store[200];
Some snippets just make me feel uncomfortable. This is one of them.
Particularly, but not limited to, this:
*(ptr-2)=atof(store);
I would be interested to know why this makes you uncomfortable. This is part of basically the first program I have ever written, so I love tips on how to improve. The reason I did this was because the first couple of lines in the .csv file are header information, so I had to skip that stuff to get to what I need. I also did an average part to keep out any outliers. The full excerpt is: