title: Semicolon inside if statement
body: <p>I was reading a page about IPC: Message Queue, that's when i came across the following section of code. </p>
  
  <pre><code>#include &lt;sys/ipc.h&gt;; 
  #include &lt;sys/msg.h&gt;; 
  
  ... 
  
  
  key_t key; /* key to be passed to msgget() */ 
  int msgflg /* msgflg to be passed to msgget() */ 
  int msqid; /* return value from msgget() */ 
  
  ...
  key = ...
  msgflg = ...
  
  if ((msqid = msgget(key, msgflg)) == &amp;ndash;1) //*****Semicolon inside IF*****
    {
      perror("msgget: msgget failed");
      exit(1);
     } else
      (void) fprintf(stderr, &amp;ldquo;msgget succeeded");
  ...
  </code></pre>
  
  <p>The above code illustrates msgget() function. Whatever, in the above code the semicolon inside If statement is allowed by syntax? Does it have any meaning?</p>