And the part which does the real work, function calc(). Current version:

1234567891011

void reshte::calc()
{
while (*s)
{
if (*s==x)
{
c++;
s++;
}
}
}

Well, there's an ambiguity there, We have two different variables, each named 's' (the cause of the compiler error). Which one is this meant to refer to? There's also a problem that when the if condition is false, the values of c and s are not incremented, thus the next time around the same values will be tested again, and an infinite loop results.