title: warning: unused variable ‘arrPixel’ [-Wunused-variable]
body: <p>Main.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include "steganography.h"  // call steganography class
  
  const int arrSize = 30000;//array for contains pixels
  using namespace std;
  int main()
  
  {
      char FileName[20] = "new.txt";
      char NewFile[20] = "new.ppm";
      char arrPixel[arrSize] = {};
      int count = 0;
      int option;
      Steganography A;//create the reference of steganopragpy class
      cout&lt;&lt;"Choose Enocde/Decode[1/2]"; // take option from user
      cin&gt;&gt;option;
      switch(option)
      {
      case 1:
      cout &lt;&lt; "Enter PPM File Name" &lt;&lt; endl;
      cin&gt;&gt;FileName;
      cout &lt;&lt; "Enter Output File Name"&lt;&lt; endl;
      cin&gt;&gt;NewFile;
      A.readImage(FileName, arrPixel);//call readImage method
      cout &lt;&lt; "Encoded Successfully completed:" &lt;&lt; endl;
      A.printImage( NewFile, arrPixel);//write ppm
      break;
      case 2:
      cout &lt;&lt; "Enter Input File Name" &lt;&lt; endl;
      cin&gt;&gt;FileName;
      cout &lt;&lt; "Enter Output PPM File Name"&lt;&lt; endl;
      cin&gt;&gt;NewFile;
      A.readCipherText( NewFile, arrPixel);//call read file method
      cout &lt;&lt; "Decoded Successfully completed:" &lt;&lt; endl;
      A.printCipherText(FileName, arrPixel);//write ppm
      break;
  
          default:
              cout&lt;&lt;"wrong choice";
      }
  
    //  cout &lt;&lt; NewFile &lt;&lt; endl;
      for(int ct = 0; ct &gt; arrSize; ct++)
      {
          cout &lt;&lt; arrPixel[ct];
      }
  
  
      return 0;
  }
  </code></pre>
  
  <p>steganography.cpp </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include "steganography.h" // call steganography class
  const int arrSize = 30000;//array for contains pixels
  using namespace std;
  
  Steganography::Steganography()//call steganography constructor
  {
  
      char arrPixel[arrSize] = {};
  }
  
  
  void Steganography::readImage(char* FileName, char* arrPixel)//read image
  {
      ifstream infile (FileName);//open file
      if(infile.is_open())
      {
          for(int count = 0; count &lt; arrSize; count++)
          {
              infile &gt;&gt; noskipws &gt;&gt; arrPixel[count];
          }
      }
      else
      {
          cout &lt;&lt; "Error opening new file." &lt;&lt; endl;
          //abort();
      }
      infile.close();
      }
  
  void Steganography::readCipherText(char* FileName, char* arrPixel)//read text file contains ppm info
  {
      ifstream infile (FileName);
      if(infile.is_open())
      {
          for(int count = 0; count &lt; arrSize; count++)
          {
              infile &gt;&gt; noskipws &gt;&gt; arrPixel[count];
          }
      }
      else
      {
          cout &lt;&lt; "Error opening new file." &lt;&lt; endl;
          //abort();
      }
      infile.close();
      }
  
  void Steganography::printImage(char* NewFile, char* arrPixel)//write image
  {
  
    ofstream outfile (NewFile);
  
      if(outfile.is_open())
  
      {  
  
         int count = arrSize;
          for(int i = 0; i &lt; (count - 1); i++)
          {
              outfile &lt;&lt; arrPixel[i];
          }
      }
      else
      {
          cout &lt;&lt; "Error opening new file." &lt;&lt; endl;
        //  abort();
  }
      outfile.close();
  
  }
  void Steganography::printCipherText(char* NewFile, char* arrPixel)//write ppm file
  {
  
    ofstream outfile (NewFile);
  
      if(outfile.is_open())
  
      {  
  
         int count = arrSize;
          for(int i = 0; i &lt; (count - 1); i++)
          {
              outfile &lt;&lt; arrPixel[i];
          }
      }
      else
      {
          cout &lt;&lt; "Error opening new file." &lt;&lt; endl;
        //  abort();
  }
      outfile.close();
  
  }
  </code></pre>
  
  <p>steganography.h</p>
  
  <pre><code>#ifndef STEGANOGRAPHY_H
  #define STEGANOGRAPHY_H
  #include &lt;string&gt;
  #include &lt;vector&gt;
  class Steganography {
   private:
    // Image header
    std::string image_type;
    int width, height;
    int max_color_depth;
    // Image data
    std::vector&lt;int&gt; color_data;
  
    // Hidden data
    std::string ciphertext;      
    int getNthBit(char cipher_char, int n);
  
   public:
    Steganography(void);     //Constructor    
    void readImage(char*,char*);
  
  
  
    void printImage(char*,char*);
  
  
  
    void readCipherText(char*,char*);
  
  
    void printCipherText(char*,char*);
  
  
    void cleanImage();
  
  
    void encipher();
  
  
  
    void decipher();
  
  };
  
  #endif
  </code></pre>
  
  <p>When I compile, i get this warning:</p>
  
  <pre><code>steganography.cpp: In constructor ‘Steganography::Steganography()’:
  steganography.cpp:11:10: warning: unused variable ‘arrPixel’ [-Wunused-variable]
  </code></pre>
  
  <p>Can someone help me figuring out the problem. Also,I have to write this line const int arrSize = 30000; in both Main.cpp and steganography.cpp to avoid getting errors, is there a way to write it only on steganography.cpp without getting errors? </p>