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.

Can you include a little bit more detail? Perhaps also some relevant code?
If you could at least post the relevant bits from your .h and .cpp file it would be very helpful to actually see things in context and make it easier to diagnose the problem.

As it stands there isn't really enough info in your post to allow anybody to help you particularly well.

Offhand, the errors about set and string could possibly be because you've perhaps forgotten to #include the headers for set and string in your header file (or maybe you could forward declare set and string and then #include their headers in your .cpp file).
Other than that, I'm not sure how much help we can be ATM.

Cheers for now,
Jas.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.