title: Calculating length of array in c++
body: <p>I have a code that is written in java and I want to convert it into c++, I don't find a way to calculate the length of the array in the c++</p>
  
  <p>Java Code:</p>
  
  <pre><code>public void printPerm(int[][] p){
      for(int i=0;i&lt;p.length;i++){
          for(int j=0;j&lt;p[i].length;j++)
              System.out.print(p[i][j]);
          System.out.println();
      }
  }
  </code></pre>
  
  <p>Converted c++ code </p>
  
  <pre><code>void printPerm(int **p)
  {
   for (int i = 0;i &lt; sizeof(p) / sizeof(p[0]) ;i++)
   {
      for (int j = 0;j &lt; (p[i].length);j++)
      {
          cout &lt;&lt; p[i][j]; 
      }
      cout &lt;&lt; endl;
   }
  }
  </code></pre>
  
  <p>I need to convert "p[i].length" to corresponding one in C++, where i will loop through the number of items in array p and j will loop through the length of each item in the array p[i] </p>