title: Identifier is undefined on initialization
body: <p>I am new to C++ Programming. I am using a cpp file to hold various variables and I am a bit concerned I am doing something wrong here. I have a .cpp file that only holds some variables.</p>
  
  <pre><code>    #include "Variables.h"
  
      using namespace::std;
  
      char ListItem[260] = "&lt;Choose Location&gt;";
      string sqlDirectiveMessage = "";
      int locationIndex = -1;
      int selectionIndex = 0;
      int dataGatheredFromIndex = 0;
      SQLCHAR retconstring[1024];
  </code></pre>
  
  <p>and Variables.h</p>
  
  <pre><code>#pragma once
  #include &lt;Windows.h&gt;
  #include &lt;sqlext.h&gt;
  #include &lt;sql.h&gt;
  #include &lt;vector&gt;
  #include &lt;sqltypes.h&gt;
  #include &lt;string&gt;
  
  using namespace::std;
  
  extern char ListItem[];
  extern string sqlDirectiveMessage;
  extern int locationIndex;
  extern int selectionIndex;
  extern int dataGatheredFromIndex;
  
  extern SQLCHAR retconstring[1024];
  </code></pre>
  
  <p>Piece of relevant code:</p>
  
  <pre><code>    case IDC_ADD:
      {
          int test = 0;
          HWND listbox = GetDlgItem(hwnd, IDC_LIST3);
          selectionIndex = (int)SendMessage(listbox, LB_GETCURSEL, 0, 0);
          dataGatheredFromIndex = (int)SendMessage(listbox, LB_GETITEMDATA, selectionIndex, 0);
  
      }
      break;
  </code></pre>
  
  <p>now in this case, if I do a Watch in VS 2017 on a few variables, selectionIndex and locationIndex seems to work fine, test is undefined and so is dataGatheredFromIndex.. Am I doing something wrong?</p>