title: How do Unary operators work in C, you cannot pre increment zero
body: <p>I am confused about how Unary Operators work in C for Ones Complement, Logical Negation and preincrementing.</p>
  
  <p>Ones complement works against 0 like this:</p>
  
  <pre><code>int main()
  {
      int a;
      a = ~0;          // Ones complement
      printf("%d",a);  // prints as -1.
  }
  </code></pre>
  
  <p>And logical negation works against 0 like this:</p>
  
  <pre><code>int main()
  {
      int a;
      a = !0;          // Logical negation
      printf("%d",a);  // prints as 1.
  }
  </code></pre>
  
  <p>But Preincrement against 0 generates a compiler error:</p>
  
  <pre><code>int main()
  {
      int a;
      a = ++0;        //pre incrementing 0.  error: non-lvalue in increment
      printf("%d",a); 
  }
  </code></pre>
  
  <p>Why don't all three work considering they are all Unary Operators?</p>