Answer difference between two compiler
<p>I compiled the following code, But I got a serious problem.
When I compiled this code in visual studio 2015, It works perfectly.
However When I compile this code in Dev C++, I think it doesn't print "Yes" as an answer.</p>

<p>For example, when I type words like,</p>

<ol>
<li>lol  </li>
<li>Was it a car or a cat i saw?  </li>
<li>abcdefghiihgfedcba  </li>
</ol>

<p>these inputs must return yes, but in dev c++ returns no.</p>

<p>Why does this problem occur?</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

bool is_palindrome(char input[], int numOfSlots);

int main(void) {

   char text[256], fixed[256];
   cin.getline(text, sizeof(text), '\n');

   for (int i = 0; i &lt; sizeof(text); i++) {
      text[i] = toupper(text[i]);
   }

   int j = 0;
   for (int i = 0; i &lt; sizeof(text); i++) {
      if ((text[i] &gt;= '0' &amp;&amp; text[i] &lt;= '9') || (text[i] &gt;= 'A' &amp;&amp; text[i] &lt;= 'Z')) {
         fixed[j] = text[i];
         j++;
      }
   }
   fixed[j] = '\0';
   string s_fixed = fixed;

   if (is_palindrome(fixed, s_fixed.length()) == true) {
      cout &lt;&lt; "Yes";
   }
   else {
      cout &lt;&lt; "No";
   }
   return 0;
}

bool is_palindrome(char input[], int numOfSlots) {
   int i = 0;
   while (i &lt; numOfSlots / 2)
   {
      if (input[i] != input[(numOfSlots - 1) - i])
         return false;
      i++;
   }
   return true;
}
</code></pre>