You are not using the std function properly. You are trying to pass a string for the delimiter rather than a character. If that is the delimiter you need, getline will not help you off-hand.
http://www.cplusplus.com/reference/string/string/getline/
Here you can find a working code for what you would like to achieve:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string message;
cout << "Enter the message>";
cin >> message;
cout << message.substr(0, message.find("!!")) << endl;
return 0;
}
You need to run this command or something similar for your scenario: g++ main.cpp && a.out
Output is:
Enter the message>sadfsadfdsafsa!!4252435
sadfsadfdsafsa