compare c string using pointer

int compareString(char str1[], char str2[])
{
char *p1 = str1, *p2 = str2; // create two pointers
// assign them to the strings
// HINT: Loop through pairs of characters on both strings
// (compare each character of similar position from both strings).
// Return 0 if all character pairs are the same throughout the
// string, otherwise return 1 or some other value...
}
void test2()
{
char str1[] = "Pointers are fun and easy to use";
char str2[] = "Pointers are fun and easy to use";
cout << str1 << endl << str2 << endl;
if (compareString(str1, str2) == 0)
cout << "The two strings are IDENTICAL" << endl;
else
cout << "The two strings are NOT IDENTICAL" << endl;
}
int main()
{
//test1();
test2();
return 0;
}
how to compare it? sorry i really dumb
closed account (48T7M4Gy)
So what's the game? I did your reverse strong one and now you're playing the same game with this. We don't do homework.

Show us what you've done.
Topic archived. No new replies allowed.