title: Why is my conditional operator giving me an error?
body: <pre><code>int a=2, b=22;
  a&gt;b?a:b=222;
  </code></pre>
  
  <p>This code is giving me an error. I think it's because the conditional operator returns the value of <code>a</code> or <code>b</code> based on the condition, so the value cannot be used as <code>Lvalue</code>. In my case, 22=222, so it's an error.</p>
  
  <pre><code>int *i, *j, a=2,b=222;
  i = &amp;a;
  j = &amp;b;
  a&gt;b?i:j=&amp;a;
  </code></pre>
  
  <p>The compiler throws an error in this case also. According to my assumption, as in the previous case, here it returns a value of <code>i</code> or <code>j</code>. So 0x123 = &a; [let 0x123 is the address stored in j]. Isn't valid? </p>
  
  <p>At this point, I made a <a href="https://stackoverflow.com/questions/17665793/directly-assigning-values-to-c-pointers">search</a>. And I tried <code>0x123 = &amp;a;</code>, but the compiler still throws an error. I guess the compiler will not allow me to modify memory locations for security reasons. </p>
  
  <p>Please let me know all my assumptions are valid, and tell me what security error will occur if a programmer is allowed to manipulate memory locations. I assume that a memory location may contain a value that should not be modified.</p>
  
  <p><strong>EDIT</strong>
     The error is <code>error: lvalue required as left operand of assignment</code>.</p>