you define std::ifstream myfile; in the function void symbol::openFile(). So its 'scope' is limited to that function. When that function returns, your variable myfile is destroyed.
If you want a variable to persist between member function calls you need to give them 'class scope' rather than 'function scope'.
You need to define them in your class declaration rather than in the function definition:
class symbol
{
private:
std::ifstream myfile; // define it here
public:
void openFile();
void parseCSV(int* ptr);
};
void symbol::openFile()
{
myfile.open("info.csv"); // open it here
}
void symbol::parseCSV(int *ptr)
{
openFile();
std::string data;
while(myfile.good()) // use it here also
{
getline(myfile, data, ',');
*ptr=data;
*ptr++;
}
}