title: Is there a difference between these two uses of sizeof?
body: <p>I want to allocate some space for a VBO. The function to do this (in OpenGL) is:</p>
  
  <pre><code>void glBufferData(GLenum  target,
                    GLsizeiptr  size,
                    const GLvoid *  data,
                    GLenum  usage);
  </code></pre>
  
  <p>In a tutorial i'm reading, the size is calculated by:</p>
  
  <pre><code>N_VERTS*P_SIZE*sizeof *pos,
  </code></pre>
  
  <p>where <code>N_VERTS</code> is the number of vertices and <code>P_SIZE</code> is the dimension (2D/3D...).</p>
  
  <p>I'm using :</p>
  
  <pre><code>sizeof(pos)
  </code></pre>
  
  <p>Is there a difference between them? My tests didn't show any difference. Also what does this mean?</p>
  
  <pre><code>sizeof *pos
  </code></pre>
  
  <p>My guess was that it's equal to</p>
  
  <pre><code>sizeof(pos)/sizeof(float)
  </code></pre>
  
  <p>but my tests show me it's not.</p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>#define N_VERTS 3
  #define P_SIZE 2
  
  float pos[N_VERTS*P_SIZE] =
  {
      -0.8, -0.8,
      0.8, -0.8,
      0.0, 0.8
  };
  </code></pre>