please someone edit this code for me.
I do not know how to write the logic part in the function 'TestAnagram'
when i debug it, it shows the same word twice instead of showing two different words using the same letters in different order .
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
int TestAnagram (char []); // function prototype
void main()
{
char StringA [256];
cout << "Enter a word " << endl;
cin >> StringA;
cout << StringA; // echo print the word
cout << StringA << (TestAnagram(StringA) ?
". is anagram\n" :
". is NOT anagram\n");
cout << "End program ";
getch();
}
int TestAnagram(char TempString [])
{
const int False = 0,True = 1;
int i, length, CheckAnagram, leftName = 0, rightName = 0;
i = 0;
length = strlen(TempString) - 1;
CheckAnagram = True;
while (leftName != rightName)
{
if (TempString[i] == TempString[length])
{
cout << " " << CheckAnagram;
}
else
CheckAnagram = False;
}
// end loop
return CheckAnagram;
}