title: printing values in array pointer in C
body: <p>I can't seem to wrap my head around a problem. What am I missing?</p>
  
  <p>Consider the following</p>
  
  <pre><code>int main(int argc, char *argv[]) {
      while ( *argv ) {
          printf("argv[] is: %s\n", *argv);
          ++argv;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>This prints out every value of argv. So a command line such as <code>./example arg1 arg2</code> would output the following:</p>
  
  <pre><code>`argv[] is: ./example`
  `argv[] is: arg1`
  `argv[] is: arg2`
  </code></pre>
  
  <p>Now consider the following (which I am having trouble with):</p>
  
  <pre><code>int main(void) {
      char *days[] = {
          "Sunday",
          "Monday",
          "Tuesday"
      };
      while ( *days ) {
          printf("day is %s\n", *days);
          *days++;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>If I try to compile, I get error <code>cannot increment value of type 'char *[3]'</code></p>
  
  <p>If I change <code>*days++</code> to <code>(*days)++</code> it compiles. If I run it, it runs forever and eventually fails with <code>bus error</code>.</p>
  
  <p>However, it does not iterate through every value of <code>days[]</code>. I even tried putting in a Null pointer in the form of <code>'\0'</code> and <code>"\0"</code> in the days array to no effect.</p>
  
  <p>What am I missing?</p>