Hi can anyone help? I'm reading in strings from a file and calling a function to determine if string first is in string second. If it is then the function will remove string one from string two and return true or false to main. Here is my code:
//Function to determine if the first word of the original string is found
//in the second string for example if 'sage' is found in 'message' main will remove sage from message and message will now be 'mes'
bool snipsame(string first, string second)
{
string::size_type pos;
int len;
@tyky9808
Your function works but it needs the second argument of the function to by passed by reference if you want it to affect the string passed: bool snipsame(string first, string &second) (notice the '&' ) http://www.cplusplus.com/doc/tutorial/functions2.html