#include <iostream>
#include <cstring>
using namespace std;
// function to reverse string str1 and copy it to string str2
void reverseString(char str1[], char str2[])
{
char *p1, *p2; // create two pointers
// Hint: Start and point both pointers to the two opposite
// ends of each string. Copy the character at one end of
// the original string to the opposite end of the new string,
// and so forth...
// Remember to add the termination character \0 at the end
// of the new string
p1=str1
}
// test function to test out reverseString()
void test1()
{
char str1[] = "Pointers are fun and easy to use";
char str2[strlen(str1)+1];
reverseString(str1, str2);
cout << "Original: " << str1 << endl;
cout << "Reversed: " << str2 << endl;
}
int main()
{
test1();
return 0;
}
i going to reverse string but i cant understand the hints given,anyone can help me?