First, I don't see how your code would even compile. Your declaration of the map object is a mess. Were you trying to create a map object that takes a string as the first iterator and a set as the second? Then you were you trying to say that you wanted your set to be a string? The way that you've written it, you didn't set a constructor for the set object.
So, let's say that you did want it that way...then your constructor would be:
map<string,set<string>> token;
That would be the first step. But then you have to understand how the map and the set work.
The map lets you assign an object based on a string (in our example). So, a key of "s1" would give you the set for that key. That set would then contain a single string matching the first character in the input.
So, doing
token.find(label)
returns a map object. You would then need to access one of the properties of that map. Using intellisense, you would see that there are two: first and second. First refers to the key. Second to the set object.
So, doing
token.find(label)->second
gives you the set object. Now, you need to get the string in that set. With the set, you would want to use the method
begin()
.
But, that only returns a pointer. So you need to access what is at that pointer.
So, doing
*(token.find(label)->second.begin())
would give you the actual letter that you're looking for.
On a side note, you put a semi-colon at the end of your if statement. That ends the if statement.
I believe what you really want is:
if (*(token.find(label)->second.begin()) == "+")
cout<<"addition symbol";
Also, creating a map with a set that contains a single string is a bit silly. You could just do it with a string and minimize the headaches.