title: How to change value of variable passed as argument?
body: <p>How to change value of variable passed as argument in C?
  I tried this:</p>
  
  <pre><code>void foo(char *foo, int baa){
      if(baa) {
          foo = "ab";
      } else {
          foo = "cb";
      }
  }
  </code></pre>
  
  <p>and call:</p>
  
  <pre><code>char *x = "baa";
  foo(x, 1);
  printf("%s\n", x);
  </code></pre>
  
  <p>but it prints <code>baa</code> why?
  thanks in advance.</p>