DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: palindrome

Hybrid View

  1. #1
    Guest

    palindrome


    C++ Palindrome Code? Can anyone help me. I need it for an assignment and I'm
    not sure how to do it. Thanks....



  2. #2
    Jack Guest

    Re: palindrome


    char lpstrBuffer[] = "DEACAED";
    LPCSTR lpcstrBegin = lpstrBuffer;
    UINT nLength = strlen( lpstrBuffer );
    LPCSTR lpcstrEnd = NULL;

    if( nLength > 0 )
    {
    bool bPalindrome = true;
    lpcstrEnd = &lpstrBuffer[ nLength - 1 ];

    while( lpcstrEnd-- > lpcstrBegin++ )
    {
    if( *lpcstrEnd != *lpcstrBegin )
    {
    bPalindrome = false;
    break;
    }
    }
    }

    <tyguy85@hotmail.com> wrote:
    >
    >C++ Palindrome Code? Can anyone help me. I need it for an assignment and

    I'm
    >not sure how to do it. Thanks....
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center