You seem to be passing a char of some kind. You need a container.
Perhaps you want the array to be accessible in main()?
Code:
container_type & openR();
//return reference to your array
int main()
{
container_type my_array(openR());
//use my_array
}
so now...
Code:
container_type & openR() {
container_type ret_val;
ifstream filein;
filein.open("stores.ddf");
if (!filein) {
cout<<"\file did not open";
//return 0;
//can't return 0 anymore.
//either return a blank array and check for it in main
//or throw an exception
}
//...................
return ret_val;
};
Personally, I'd use std::string. So you could do your reading operations on
Code:
char* array = new char[len];
and then have
Code:
std::string ret_val(array);
And right before you
DON'T FORGET to
Hope that helps.