string to main function through a class

hey guys have a problem getting this done


this is my class function
void project::io()
{
string outfile;
string infile;
ifstream read;
ofstream write;

//input file is project
cout<<"Enter the input file name\n";
cin>>infile;
***read.open(infile.c_str());

//output file is test
cout<<"Enter the output file name\n";
cin>>outfile;
***write.open(outfile.c_str());


and trying to get it to the main

double y[210][16];
for (int i=0; i<=15; i++)
***{read>>y[0][i];}

for(int j=0;j<=200;j++)
{y[j][0]=0;
y[j][15]=0;}


int i, j;

for(j=0; j<=200; j++)
{
***write<<y[j][0]<<" ";
for(i=1; i<15; i++)


im stuck on how to recall the read and write from the function to get to the main

thanks in advance
closed account (o3hC5Di1)
Hi there,

It seems to me as if you haven't declared the read and write properties as public and I don't see you instantiating the class either.

I think following article will give you more clarity in how to use classes:
http://cplusplus.com/doc/tutorial/classes/

If I am mistaken I do apologise, but in that case please post the complete code (in code blocks preferably).

All the best,

NwN
Topic archived. No new replies allowed.