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?


8 Years
Discussion Span
Last Post by JasonHippy

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,

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.