title: `static`, `extern`, `const` in header file
body: <pre><code>//a.h
  
  extern int x1;
  static int x2;
  int x3;
  static const int x4;
  
  class A {
      public:
          static const int x5 = 10;
  };
  </code></pre>
  
  <p><code>a.h</code> will be included by multiple <code>.cpp</code> files, my question is:</p>
  
  <p>1.<code>x1</code> is just a declaration, isn't it? So its definition should be done in one of those <code>.cpp</code> files, right?</p>
  
  <p>2.<code>x2</code> is a definition, right? I used to think that <code>static int</code> is also a declaration just like <code>extern int</code>, but I was wrong. <code>x2</code> will only be visible in <code>a.h</code>?</p>
  
  <p>3.<code>x3</code> will be defined multiple times if <code>a.h</code> is included in multiple <code>.cpp</code> files, so <code>x3</code> will result in compile-error, right?</p>
  
  <p>4.<code>x4</code> is a definition, right?</p>
  
  <p>5.Here in class A, <code>x5</code> is a declaration, yes. But what about <code>x4</code>?</p>