title: error: ‘length’ was not declared in this scope c++
body: <p>I am beginner c++ programmer, It's my first program even (For those who are very keen to give negatives). I had written the same code in c but now trying to do in c++.
  Where I get the following error.</p>
  
  <p><code>error: ‘length’ was not declared in this scope</code></p>
  
  <p>My code is as below.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;assert.h&gt;
  using namespace std;
  
  
   class Huffman
   {
      public:
  
      int data_size, length; //THis length variable is not accessible in main function below in main function.
       Huffman(char *filename);
     ~Huffman();
  
      struct Huffman1
      {
      int value;
      unsigned char sym;                 /* symbol */
      struct Huffman1 *left,*right;    /* left and right subtrees */
      };   typedef struct Huffman1 Node;
  
   };
  
   Huffman::Huffman(char * file_name)
   {
  
   //I will do something here soon
  
   }
    Huffman::~Huffman()
   {
  
   }
  
  
   int main(int argc, char * * argv)
   {
        length=10; //Not accessible here.
       if (argc &lt; 2)
      {
          cout&lt;&lt;"Ohh.. Sorry , you forgot to provide the Input File please" &lt;&lt;endl;
          return(0);
      }
       Huffman Object1(argv[1]);
  
       return(0);
  
  
  }
  </code></pre>
  
  <p>I am not sure that it's c++ programming error because it may be because i am compiling it <code>g++ Filename.c -o filename</code>. Could someone please correct if it's a programming error or it's due to the way i compile ?
  thanks.</p>