title: c++ programming define array size from the external input file?
body: <p>I want to define array size from the external input.</p>
  
  <p>I create the code like this </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;iomanip&gt;
  using namespace std;
  
  void loadIt(int[],int);//loadIT prototype
  
  int main()
  {   
      ofstream outfile("C:\\sir.txt");
      if (!outfile){
      cerr &lt;&lt; "Output file could not be opened" &lt;&lt; endl;
      exit(1);}
  
      outfile &lt;&lt; setiosflags(ios::fixed|ios::showpoint);
      outfile &lt;&lt; setprecision(3);
      outfile &lt;&lt; setiosflags(ios::fixed|ios::showpoint);
      outfile &lt;&lt; setprecision(3);
  
      const int arraySize = 20; //here i want the input from the external file
      int a[arraySize];
  
  
       loadIt(a, arraySize);//call to loadIT
  
  }
  </code></pre>
  
  <p>i want to define array size from the external file..plz help me</p>