title: "If statement" is not working properly in c
body: <p>I have written a program with a function that looks at a two dimensional array ir_data[60][768].</p>
  <p>The While loop should call the &quot;Hotspotberechnung&quot; function only when there is a value that equals or is over 30 in a given row.
  &quot;Hotspotberechnung&quot; should store the given row in an array[24][32] and then print the array.</p>
  <p>The problem is that the program prints an array without any values equal or over 30.</p>
  <p>Unfortunately, I cannot find the mistake on my own.</p>
  <p>The While Loop:</p>
  <pre><code>int8_t Temperatur[768] = {0};
  
  while (get_ir_data( &amp;Temperatur[0], sizeof(Temperatur)/sizeof(Temperatur[0])) == 0)
  {
     for(int k=0; k&lt;768; k++)
     {
         if(Temperatur[k] &gt;= 30)
         {
            Hotspotberechnung(Temperatur,bild);
         }
  
      }
  }
  </code></pre>
  <p>The function :</p>
  <pre><code>bool Hotspotberechnung(int8_t tabelle1[768],int8_t tabelle2[24][32])
      {
          int i=0, j=0, x=0, y=0;
  
          for(j=0; j&lt;24; j++)                             //Tabellen werden gefüllt
          {
              for(i=0; i&lt;32; i++)
              {
                  tabelle2[j][i] = tabelle1[(j*24)+i];
              }
          }
          for(j=0; j&lt;24; j++)
          {
              for(i=0; i&lt;32; i++)
              {
                  printf(&quot;%d.%d=%d\n&quot;,j,i,tabelle2[j][i]);
              }
          }
  </code></pre>
  <p>get_ir_data :</p>
  <pre><code>int8_t get_ir_data(int8_t* data, int n)
  {
      static uint8_t idx = 0;
  
      if (n != 24 * 32) {
          printf(&quot;Invalid size of array data!\n&quot;);
          return -1;
      }
  
      memcpy(data, ir_data[idx], n);
      idx++;
  
      if (idx &gt;= sizeof(ir_data) / sizeof(*ir_data))
          return -2;
  
      return 0;
  }
  </code></pre>