This is a fragment of a program for finding palindrome numbers.Every checked number is a string which is reversed...and I'm using array of strings which isn't done right. Any help will be greatly appreciated.
#include <stdio.h>
#include <string.h>
void isPalindrome(char *str1[],int l){
int str1size = strlen(str1[l]);
int n;
int misMatch = 0;
char *str2[20];
for(int i = (str1size - 1); i>=0; i--)
{
n = (str1size - 1) - i;
str2[n] = str1[i];
}
for (int j=0;j<=(str1size-1);j++){
if (str1[j]!= str2[j])
misMatch++;
}
if (misMatch)
printf("\nNot palindrome\n");
else
printf("\nA paliindrome\n");
}
int main(){
char *str1[20];
str1[0] = "9009";
str1[1] = "2345";
for(int l=0; l<2; l++)
isPalindrome(str1,l);
return 0;
}