#include <iostream>
#include <string>
using namespace std;
void stringrev(char *n);
string user_input;
int main()
{
string user_input;
int palindrome_test;
cout << "Please input a word to be tested:";
cin >> user_input;
cout << "The word to be tested is: "
<< user_input;
palindrome_test = stringrev(user_input);
if(user_input == stringrev)
{
cout << "The word tested is a palindrome.";
else
cout << "The word tested is not a palindrome.";
}
return 0;
}
void stringrev(temp *n)
{
int i = 0;
int len = strlen(n) - 1;
char temp;
while((len - i) > i)
{
temp = n[len-i];
n[len - i] = n;
n = temp;
i++;
}
cout <<endl;
}
anyone wanna take a crack at it and tell me wtf is wrong..im too tired to think.
#include <string>
using namespace std;
void stringrev(char *n);
string user_input;
int main()
{
string user_input;
int palindrome_test;
cout << "Please input a word to be tested:";
cin >> user_input;
cout << "The word to be tested is: "
<< user_input;
palindrome_test = stringrev(user_input);
if(user_input == stringrev)
{
cout << "The word tested is a palindrome.";
else
cout << "The word tested is not a palindrome.";
}
return 0;
}
void stringrev(temp *n)
{
int i = 0;
int len = strlen(n) - 1;
char temp;
while((len - i) > i)
{
temp = n[len-i];
n[len - i] = n;
n = temp;
i++;
}
cout <<endl;
}
anyone wanna take a crack at it and tell me wtf is wrong..im too tired to think.
