I need to split the string on . in C++..
Below is my string -
@event.hello.dc1
Now I need to split on . on the above string and retrieve the @event from it and then pass @event to the below method - 
bool upsert(const char* key);
Below is the code I have got so far after reading it from here -
void splitString() {
    string sentence = "@event.hello.dc1";
    istringstream iss(sentence);
    copy(istream_iterator<string>(iss), istream_iterator<string>(), ostream_iterator<string>(cout, "\n"));
}
But I am not able to understand how to extract @event by splitting on . using the above method as the above method only works for whitespace... And also how to extract everything from that string by splitting on . as mentioned like below - 
split1 = @event
split2 = hello
split3 = dc1
Thanks for the help..
 
     
     
     
     
    