C++ program to detect palindrome words

I'm trying to create a program that allows the user to input a word (I am using cin.getline to put the input into a char array), and then calls a function to determine if the word is a palindrome. If it is, I cout << "It's a palindrome." and if not, I cout the opposite. My problem is that my code will not compile and I can't figure out why. Here is the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<iostream>
#include<string>
#include<cstring>
using namespace std;

int pcheck(char word[], char rword[], const int SLEN);

int main(){
  char w[100];
  int  p;

  cout << "Which word would you like to check to see if it's a palindrome?" << endl;
  cin.getline(w, 99);
 const int SLEN=strlen(word);
 char rword[SLEN];
for(int i=0, i<SLEN, i++){
       rword[i]=word[SLEN-i];
    }
  int p=pcheck(word, rword, SLEN);
  if(p==SLEN){
    cout << "It is a palindrome!" << endl;
    }
  else{
    cout << "It is not a palindrome." << endl;
  }
}
int pcheck(char word, char rword, const int SLEN){
  int j=0, partn=0;
  while(j<SLEN){
    if(word[j]==rword[j]{
        partn++;
      }
      else{
        cout << "Not a palindrome" << endl;
      }
j++
      }


In case you can't understand my logic, I am trying to get the word, reverse it, and then compare each letter in the two arrays. If they are the same letter, I increase a counter which is returned to main. If the returned number is the same as the length of the array, it is a palindrome. I just can't figure out what is wrong with my program causing it to be unable to compile.
Topic archived. No new replies allowed.