I want to check szDir
in szSelectedDir
. I want the function to consider the below inputs are different. My sample function is not handling the scenario, please let me know the good solutions.
string szSelectedDir ="C:\\Windows1\Test";
string szDir="C:\\Windows";
void IsWindowsDirectory(const string szSpecialPath, const string szSelectedPath)
{
if(szSelectedPath.compare(szSpecialPath) == 0)
{
printf("Both paths are same ");
}
else if(szSelectedPath.find(szSpecialPath) != string::npos)
{
printf("Both paths are same ");
}
else
{
printf("Both paths are different ");
}
}