Hello! So I have to write several functions in a program to pass certain tests in a test program, but the first function I am writing is causing me some difficulties.
and here is the part of the test program that it should match with
1 2 3 4 5 6 7 8 9 10 11 12 13 14
void testIsPermutation(Tester & t)
{
cout << "Testing String Conversion Functions:" << endl;
char * ptr1=(char*)"abcdefg";
char * ptr2=(char*)"cbdeagf";
t.test( isPermutation(ptr1,ptr2), "Testing two equal length strings which are permutations");
t.test(!strcmp(ptr2,(char*)"cbdeagf"), "Testing to see that strings were not altered");
ptr2=(char*)"abc";
t.test(!isPermutation(ptr1,ptr2), "Testing strings of differing length");
ptr1=(char*)"def";
t.test(!isPermutation(ptr1,ptr2), "Testing unequal strings of same length");
}
The errors I keep receiving in the test program say:
No matching function for call to 'isPermutation'
on lines 7,9,&10 in the test function.
So it's saying that it cannot find the isPermutation function, but why is that?
Hello!
Maybe isPermutation isn't of the same member class of t.
You should declare it static, and see if this works. If you could post all the code, it could be easier to help.
Bye!
#ifndef final_CS201Final_h
#define final_CS201Final_h
// bool isPermutation(); // this is not the function that you have defined
bool isPermutation(char * ptr1, char * ptr2) ; // this is
#endif