title: How can I know legth of array in C++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1975128/sizeof-an-array-in-the-c-programming-language">Sizeof an array in the C programming language?</a>  </p>
  </blockquote>
  
  
  
  <p>I have an array of char and I want to process it in a function, I tried code like this:</p>
  
  <pre><code>int main(){
      char *word = new char [5];      
      /*here we make this word
      ....
      */
  
      process(word);
      puts(word);
  }
  
  void process(char *word){
      int sizeOfWord = sizeof(word)-1;
      /* here is cycle that process the word, I need it lenght to know how long cycle must be
      .....
      */
  }
  </code></pre>
  
  <p>But I can't get the length of array with <code>sizeof</code>. Why? And how can I get that?</p>