I'm trying to read a file in a class, I do not know what I am missing. How do I call the void readfile that is in my class?
Would really appreciate some help!
you should read up on classes more. THey are objects. You are calling a string object then trying to use your fileRead object..
try something like
1 2 3 4 5
int main()
{
fileRead in;
in.readFile( "filename);
}
I have no idea what you are trying to do with sort? Are you trying to sort a string that is really your object you created? There also isn't even a writeFile function/class...
I also see no purpose in using a class in this case. You don't even have a constructor. Maybe try something like this:
Sry i forgot to specify what I was doing. Im trying to open up the file in the class, then sort it, then print it out.
Im going through each of the functions to make sure I caught all the errors.
Thanks to you I've been able to get the read function fixed, now I have to sort it.