Feb 5, 2014 at 6:30am Feb 5, 2014 at 6:30am UTC
You have are using an undeclared variable.
file.open(filename.c_str());
Maybe you meant fn
instead of filename
Feb 5, 2014 at 6:40am Feb 5, 2014 at 6:40am UTC
Well that certainly fixed it haha thanks giblit.
Feb 5, 2014 at 6:42am Feb 5, 2014 at 6:42am UTC
Actually how does fn work? Where did I declare this?
I thought file name was declared by
string filename;
Feb 5, 2014 at 6:49am Feb 5, 2014 at 6:49am UTC
Its the parameter you are passing.
int loc::counter(string fn)
Feb 5, 2014 at 10:57am Feb 5, 2014 at 10:57am UTC
The only place I can see that you've declared a variable called filename is inside loc::count() . Within the scope of loc::counter() , you haven't declared anything with that name.
Last edited on Feb 5, 2014 at 10:58am Feb 5, 2014 at 10:58am UTC