20
Following is the code snippet of what I did, can some body help me where I have wrongly coded it:
#include<iostream>
using namespace std;
void modifyName(string &name)
{
size_t sep = string::npos;
sep = name.find_first_of(".");
if(sep != string::npos) { name[sep] = '\0'; }
}
int main()
{
string name("test.rtl");
string someName("test");
modifyName(name);
if( someName == name ) //Failing??
cout<<"MATCHED"<<endl;
return 0;
}