title: Is it legal to treat a pointer like an array?
body: <pre><code>void uc(char* s)
  {
      int i;
  
      for( i=0; i &lt; strlen(s); i++ )
          if (97 &lt;= s[i] &amp;&amp; s[i] &lt;= 122)
              s[i] = s[i] - 32;
  
      return;
  }
  </code></pre>
  
  <p>My professor showed our class this operator.</p>
  
  <p><code>char* s</code> copies an array, this is ok because an array name is it's first element memory address.</p>
  
  <p>Now my problem is: why do we treat the pointer <code>s</code> as an array in the <code>for</code> cycle?<br>
  Pointers store addresses, but I learnt they don't have a very intuitive behaviour...</p>
  
  <p>My problem is that I consider them "as an int variable", since memory address are integers in an hexadecimal format (right?), but i know it's not so simple.</p>
  
  <p>Edit: thank you all for the answers, I'm loving this site and community &lt;3 
  As you witnessed I'm a newbie, so thank you for the patience and the nice explanations</p>