title: Using variables from another class in another file
body: <p>My question is about using one class's variables in another class in a different file.</p>
  
  <p>I have a class in Mabbs Input.h which looks like this:</p>
  
  <pre><code>class fileParameters{
  public:
       static int numImageRows;
       static int imageRowLength;
  
  private:
      int numRows=0;    
  };
  
  int numImageRows = 640;
  int imageRowLength = 480;
  </code></pre>
  
  <p>I would like to use the variables numImageRows and imageRowLength in a separate file called Image Centering.cpp. I am aware that I need to put it in the header Image Centering.h, which I have done.</p>
  
  <p>This is the code I have in Image Centering.h:</p>
  
  <pre><code>class imageCenteringParameters{
  
  public:
     static int numImageRows;
     static int imageRowLength;
  
  
  private:
      int imageArray[numImageRows][imageRowLength];
  
  };
  </code></pre>
  
  <p>I have 2 questions:</p>
  
  <p>a.) Is this the correct way to ensure I can use the variables from the class fileParameters in Mabbs Input.h in any other file? If so, is there a better/ more efficient way? If not, how would I go about fixing this, and what is good website to learn this from?</p>
  
  <p>b.) It says that the fields in imageArray must have a constant size. I thought they would since they are declared in Mabbs Input.h. How would I go about fixing this, but more importantly, what does this mean?</p>