title: In gdb sizeof(Apple::record_) is zero. But It runs well
body: <p>I encounterd a very strange g++ problem.</p>
  
  <p>The output of the flowing program is "24 8 3", All things seems ok. But when I use gdb, to print sizeof(Apple::record_), it turns out to be 0. My gcc version is 4.5.2 (GCC)(MinGw), gdb version is GNU gdb (GDB) 7.3
  Can anybody help me ??</p>
  
  <pre><code>    #include &lt;iostream&gt;
      using namespace std;
  
      struct Record {
          int age;
          const char* name;
      };
      struct Apple {
          static Record record_[];
      };
  
      Record Apple::record_[] = {
              { 18, "liming i love apple" },
              { 19, "liming" },
              { 20, "liming a y z o pq x y z o o o " } };
      int main() {
          cout &lt;&lt; sizeof(Apple::record_) &lt;&lt; " " &lt;&lt; sizeof(Apple::record_[0]) &lt;&lt; " "
               &lt;&lt; sizeof(Apple::record_) / sizeof(Apple::record_[0]) &lt;&lt; endl;
          return 0;
      }
  </code></pre>