title: error: 'begin' was not declared in this scope
body: <p>I am new to C++ and I would like to know how to use the sort function.
  This is my code and it's not working for some reasons:</p>
  
  <pre><code>#include &lt;fstream&gt;
  #include &lt;algorithm&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  int main()
  {
      ifstream in("date.in");
      ofstream out("date.out");
      int v[5]= {2, 3 ,1, 0, 5};
      sort(begin(v), end(v));
      for(int j=0; j&lt;5; j++){
          out&lt;&lt;v[j]&lt;&lt;" ";
      }
      return 0;
  }
  </code></pre>
  
  <p>The error code I get is:</p>
  
  <blockquote>
    <p>error: 'begin' was not declared in this scope</p>
  </blockquote>