this is what i have so far, i need to combine 2 c strings, print them backwards and figure out whether they are a palindrome or not.
(the for loop is where i stopped, it could be wrong)

#include<iostream> 
#include<cstring> 
using namespace std;

int main( ) 
{ 
     char s1[15], s2[8]; 
     int length1; 
     int count = 0;

     cout << "Now I let you enter two strings \n"; 
     cout << "Enter the first string, then the second \n"; 
     // Another way to initialize the two strings 
     cin >> s1 >> s2;
     strcat(s1, s2);

for(int i=0, i < length, i++)
{
        
        

      count++; 
   system("pause");
   return 0; 
}

Edited 6 Years Ago by Nick Evan: Added code-tags

Using strings, so concatenations will be easier ;

string firstName = "dani";
string lastName = "web";
string fullName = firstName + lastName; //concatenation
string tmp = fullName;
//reverse
std::reverse(fullName.begin(),fullName.end());
if(fullName == tmp){ cout << "Palindrome\n"; }
else cout << "Not Palindrome\n";
void main();
{
inst set=0;
char a[10];
char b[10];

for(i=0;i<10;i++)
{
for(j=10;j>0;j--)
{
if(a[i]==b[j])
{
if(a[i]==a[10])
set=1;
}
else
{
break;
}
}
if(set==1)
printf("palindrome");
else
{
printf("not");
}
}

Edited 6 Years Ago by Nick Evan: added code-tags

Comments
Useless, non standard, non working, unformatted code
int main()
{int set=0;
char a[10];
char b[10];
char *p1=a;
char *p2=&b+1 ; // for pointing memory just nxt to string
*p2--;//points "/0"
*p2--; //points end now
for(i=0;i<strlen(a[10]);i++)
{
if(*p1==*p2)
{
if(p1->next=null ||p1->next="")
 {
set=1;
 }
}
else
{
break;
}
*p1++;
*p2--;
}
if(set==1){ printf("palindrome");
}
else
{printf("not");
}


}

Edited 6 Years Ago by Nick Evan: added code-tags (again)

Comments
this is utter nonsense
learn to use the code tags already!

can any one send me C++ code for 2-3-4 tree insertion, deletion and search code plz...email snipped

Edited 6 Years Ago by WaltP: email snipped

This article has been dead for over six months. Start a new discussion instead.