#include <stdio.h>
#include <stdlib.h>
void porownaj(char str1[],char str2[]){
int dl = strlen(str2);
char str3[30]=" ";
int i;
for(i=dl;i>=0;i--){
str3[i]+=str2[i];
}
int cmp = strcmp(str1,str3);
if(cmp==0){
printf("Jest palindromem");
}
else
printf("nie palintrom");
}
int main()
{
char str1[30];
char str2[30];
printf("Wypisz slowo: ");
scanf("%s",str1);
printf("Wypisz slowo: ");
scanf("%s",str2);
porownaj(str1,str2);
return 0;
}
Program nie działa poprawnie. Nie mogę zamienić poprawnie słowa str2 na str3 i nie wiem jak to zrobić.