header file problem...

my code includes this function

void read(set<string> &mySet);

but when i put this line in the header file, i get the following errors:

error: variable or field 'read' declared void
error: 'set' was not declared in this scope
error: 'string' was not declared in this scope
error: 'mySet' was not declared in this scope

so, what should i write to make this thing work?

thanks.
Don't put it inside your main function. It needs to go above the line int main()
the function in question is in another file. im using the header file thingie so that the main() will see the function in that file.
Nothing is wrong with that prototype so long as <set> and <string> are both included before that line header.

The only thing I can think of is you put the prototype somewhere inappropriate, or you have some other unrelated error that's confusing the compiler.

Or you're calling the function wrong.

Is the pasted line the one that actually is producing the error? I find that a little unlikely. If it isn't, can you paste the line that actually is giving you the error?
closed account (z05DSL3A)
void read( std::set< std::string > &mySet);?
Topic archived. No new replies allowed.