title: How sizeof works ? Memory map for variable length array of strings
body: <pre><code>const char *pointerStr[]=
  {
     "BEST123,      ",     // 0x00
     "Best2233,     ",     // 0x01
     "ABCDEFGH,     ",     // 0x02
     "123456,     ",     // 0x03
     "helloworld,     "     // 0x04
  };
  typedef struct
  {
     char value;
     char name[40]; 
  }StrInfo;
  
  typedef struct
  {
     int regMax;
     StrInfo info[60];   
  } structNew;
  
  void main()
  {
    int i;
    structNew  pret;
  for ( i=0;i&lt;5;i++)
  {     
    printf("PointerStr size of %dth %d \n",i,sizeof(pointerStr[i]));
    printf("pret size of %dth %d \n",i,sizeof(pret.info[i].name));
  }
  }
  </code></pre>
  
  <p>The above program produce the result of </p>
  
  <pre><code>PointerStr size of 0th 4 
  pret size of 0th 40 
  PointerStr size of 1th 4 
  pret size of 1th 40 
  PointerStr size of 2th 4 
  pret size of 2th 40 
  PointerStr size of 3th 4 
  pret size of 3th 40 
  PointerStr size of 4th 4 
  pret size of 4th 40 
  </code></pre>
  
  <p>If I want to know the size of each and every string in PointerStr then how to find it? Is it possible only using strlen ? do we have some other way ? How this variable length array is stored in memory ?
   The result is becoz that pointerStr is pointer variable and its size is always 4. Please correct me if I am wrong.</p>