Palindrome help

I'm a little confused by this

Page 1 of 1

1 Replies - 1121 Views - Last Post: 21 April 2008 - 10:02 PM Rate Topic: -----

#1 dazed_and_confused18   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 19-March 08

Palindrome help

Post icon  Posted 21 April 2008 - 09:06 PM

Hey guys, I'm confused with this program right here. I'm asked to code a program that checks whether a string is a pseudo-palindrome.
First, I code the following functions:
char * remove_punct(char * str, char * remstr);
char * lowercase(char * str, char * lowstr);
char * reverse (char *str, char * revstr);

and then I have to test it on "Madam I'm Adam", but I have no idea how to really get this thing going. Any help would be greatly appreciated. :)

#include <iostream>
using namespace std;

#include <string.h>
#include <cctype>
#include <cstring>

char * remove_punct(char * str, char * remstr);
char * lowercase(char * str, char * lowstr);
char * reverse (char *str, char * revstr);

void main()
{
	cin.getline(your_string, 256);
	ReverseString();
	cout << ReverseString(your_string) << "\n";
}
void LowerCase(char String){
}
void reverse()
{
	int x = strlen(your_string);
	x--;
	for(int y = x; y >= 0; y--)
	{
	 your_string[y] += your_string[y];
	}
  }


Is This A Good Question/Topic? 0
  • +

Replies To: Palindrome help

#2 iGV   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 20-April 08

Re: Palindrome help

Posted 21 April 2008 - 10:02 PM

1 ques. how many times you wanna check the string after adding to its reverse whether the resultant string is palendrome or not..

It it just once you wanna add, then simply copy the reverse of the string and add it to orginal and pass it to a palindrome check function..

If it more than once you want to add. then pass the resultant string again to to the same function(recursion)....

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


View Postdazed_and_confused18, on 21 Apr, 2008 - 09:06 PM, said:

Hey guys, I'm confused with this program right here. I'm asked to code a program that checks whether a string is a pseudo-palindrome.
First, I code the following functions:
char * remove_punct(char * str, char * remstr);
char * lowercase(char * str, char * lowstr);
char * reverse (char *str, char * revstr);

and then I have to test it on "Madam I'm Adam", but I have no idea how to really get this thing going. Any help would be greatly appreciated. :)

#include <iostream>
using namespace std;

#include <string.h>
#include <cctype>
#include <cstring>

char * remove_punct(char * str, char * remstr);
char * lowercase(char * str, char * lowstr);
char * reverse (char *str, char * revstr);

void main()
{
	cin.getline(your_string, 256);
	ReverseString();
	cout << ReverseString(your_string) << "\n";
}
void LowerCase(char String){
}
void reverse()
{
	int x = strlen(your_string);
	x--;
	for(int y = x; y >= 0; y--)
	{
	 your_string[y] += your_string[y];
	}
  }

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1