title: Receiving error: assignment makes integer from pointer without a cast
body: <p>I have below program for shared memory access in C</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;strings.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;sys/ipc.h&gt;
  #include &lt;sys/shm.h&gt;
  
  #define SHMSZ 27
  
  int main() {
      char c;
      int shmid;
      key_t key;
      char *shm, *s;
  
      key = 5678;
      /* Create the segment */
      if ((shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) &lt; 0) {
          perror("shmget");
          exit(1);
      }
  
      /* Attach the segment */
      if ( (shm = shmat(shmid, NULL, 0)) == (char *) -1) {
          perror("shmat");
          exit(1);
      }
  
      /* Put things into memory for other processes to read*/
      s = shm;
      for (c = 'a'; c &lt;= 'z'; c++) {
          *s++ = c;
      }
      *s = NULL; 
  
      /*Wait till other processes read and change the memory*/
      while (*shm != '*') {
             sleep(1);
      }
  
      exit(0);
  }
  </code></pre>
  
  <p>In this program I am getting error for below line </p>
  
  <pre><code>   *s = NULL;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>shm_server.c: In function ‘main’:
  shm_server.c:36:8: warning: assignment makes integer from pointer without a cast [enabled by default]
  </code></pre>
  
  <p>Why am I receiving this error?</p>
  
  <p>Note: I also have a other script as shm_client.c to read the memory while the server program shm_server.c waits till client program changes the first character to '*'</p>