title: Problem with converting decimal number to binary with C as translation from python code
body: <p>I tried to first write python code where everything works just fine but now when I am trying to put everything together without pointers and allocation of array nothing works as I want. I now know that number cant be represented in an array so I decided to control whether the rest from the division is zero or one than it assign string representation zero or one. --&gt; warning: assignment to 'char' from 'char *' makes integer from pointer</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  
  // IN PYTHON
  // import math
  //# 100100
  // decimal_number = 36 (36, 18, 9, 4, 2, 1, 0)
  // binary_number = &quot;&quot;
  
  // while decimal_number &gt; 0:
  //   tmp = decimal_number % 2
  //   binary_number = str(tmp) + binary_number
  //   decimal_number = math.floor((decimal_number / 2))
  // print(binary_number)
  
  int main()
  {
      int decimal_number = 4;
      int len_arr = 7;
      char binary_number[len_arr];
      int counter = 0;
      char tmp_s;
      while (decimal_number &gt; 0)
      {
          int tmp_i = decimal_number % 2;
          if (tmp_i == 0)
          {
              tmp_s = &quot;0&quot;;
          }
          else
          {
              tmp_s = &quot;1&quot;;
          }
          binary_number[counter] = tmp_s;
          decimal_number = floor((decimal_number / 2));
          counter++;
      }
      binary_number[counter] = '\0';
      printf(&quot;%s&quot;, binary_number);
      return 0;
  }
  </code></pre>