#include<iostream>
#include<conio.h>
#include<string>
usingnamespace std;
class RoughStrings {
public:
int minRoughness(string, int);
};
int RoughStrings::minRoughness(string s, int n) {
s=("i m inside function") ;
cout<<s<<endl;
return 0;}
int main(){
RoughStrings obj;
obj.minRoughness(); // error at this point =>
/* No matching function for call RoughStrings::minRoughness()' ` */
cout<<"i m in main"<<endl;
getch();
return 0;
}
You get the error, because you didn't provide the required arguments for minRoughness. You must pass a string for "a" and an integer for "n". e.g. obj.minRoughtness("foo", -1);