title: Checking if a string is a palindrome using a stack
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdbool.h&gt;
  
  typedef struct node
  {
      char data;
      struct node *link;
  }StackNode;
  
  void insertData(StackNode **);
  void push(StackNode **, char);
  void checkData(StackNode **);
  bool pop(StackNode **,char *);
  
  char sent[20] = "";
  
  void main()
  {
     StackNode *stackTop;
     insertData(&amp;stackTop);
     checkData(&amp;stackTop);
     printf("\n");
     return;
  }
  
  void insertData(StackNode **stackTop)
  {
      char c;
      int len;
  
      printf("Enter the Sentence\n");
      while( ( ( c = getchar() ) != '\n'))
      {   
          if( ( ( c&gt;='a' &amp;&amp;c&lt;='z') || (c&gt;='A' &amp;&amp; c&lt;='Z')))
          {
              if((c&gt;='A' &amp;&amp; c&lt;='Z'))
              {
                  int rem;
                  rem = c-'A';
                  c='a' + rem;
              }
              push(stackTop,c);
              len = strlen(sent);
              sent[len++]=c;
              sent[len]='\0';
          }
      }
      printf("Letters are %s\n\n",sent);
  }
  
  void push(StackNode **stackTop,char c)
  {
      StackNode *pNew;
      pNew = (StackNode*) malloc(sizeof(StackNode));
      if(!pNew)
      {
          printf("Error 100:Out of memory\n");
          exit(100);
      }
      pNew-&gt;data = c;
      pNew-&gt;link = *stackTop;
      *stackTop = pNew;
  }
  
  void checkData(StackNode **stackTop)
  {
      char c;
      int i=0;
      while(pop(stackTop,&amp;c))
      {
          if( c !=sent[i++])
          {
              printf("Not palindrome");
              return;
          }
      }
      printf("Palindrome");
  }
  
  bool pop(StackNode **stackTop,char *c)
  {
      StackNode *pNew;
      pNew = *stackTop;
      if(pNew == NULL)
          return false;
      *c = pNew-&gt;data;
      *stackTop = pNew-&gt;link;
      printf("char poped %c\n",*c);
      free(pNew);
      return true;
  }
  </code></pre>
  
  <p>I am able to pop each letter, after that the exe file is not working, I think I'm unable to check if the letters are same in reverse order. please help</p>
  
  <p>I've been working all day to write this program,but I'm stuck at this point.</p>