title: How to load a Wav file in an Array in C++?
body: <p>Hey I've a dynamic array and I want to load to this array the data of my Wav file, I already wrote the beginning but I can't figure it out how to load the file in my dynamic array, can somebody help me further with this code?</p>
  
  <pre><code>#include &lt;iostream&gt; 
  using namespace std;
  
  template &lt;typename T&gt; 
  class Array{
  public:
      int size;
      T *arr;
  
      Array(int s){
      size = s;
      arr = new T[size];
      }
  
      T&amp; operator[](int index)
      {
          if (index &gt; size)
              resize(index);
          return arr[index];
      }
  
   void resize(int newSize) { 
          T* newArray = new T[newSize];
          for (int i = 0; i &lt;size; i++)
          {
              newArrayi] = arr[i];
          }
          delete[] arr;
          arr = newArray;
          size = newSize;
      }
  };
  int main(){
  
      Array&lt;char&gt; wavArray(10);
      FILE  *inputFile;
      inputFile =fopen("song.wav", "rb");
  
          return 0;
  }
  </code></pre>