Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,069 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,600 people online right now. Registration is fast and FREE... Join Now!




Palindrome help

 
Reply to this topicStart new topic

Palindrome help, I'm a little confused by this

dazed_and_confused18
21 Apr, 2008 - 08:06 PM
Post #1

New D.I.C Head
*

Joined: 19 Mar, 2008
Posts: 7


My Contributions
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. smile.gif

CODE
#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];
    }
  }

User is offlineProfile CardPM
+Quote Post

iGV
RE: Palindrome Help
21 Apr, 2008 - 09:02 PM
Post #2

New D.I.C Head
*

Joined: 20 Apr, 2008
Posts: 2

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)....

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


QUOTE(dazed_and_confused18 @ 21 Apr, 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. smile.gif

CODE
#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];
    }
  }



User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 07:02PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month