Why is my program saying that the length function is not in my std library? : <p>My program is saying that the function length() is not in the standard library and is producing an error that does not let me run my code</p>

<p>I have tried to place two different libraries into the #include statements. I then tried to place the length function on different variables but the same error occurs.</p>

<pre><code>int main()
{
    string line;
    ifstream out_file_DOI("declaration_of_independence.txt");
    if (out_file_DOI.is_open())
    {
        int i = 0;
        while (getline(cout, out_file_DOI, i))
        {
            cout &lt;&lt; line &lt;&lt; endl;
            cout &lt;&lt; line.length();   //error is on this line...
            i++;
        }
        out_file_DOI.close();
      }
    }
    else
    {
        cout &lt;&lt; "Unable to open file...";
    }
    //creates the declaration file
    out_file_DOI.open("declaration_of_independence.txt");
  }
</code></pre>

<p>I expect the code to run and show the proper results (proper results being the program encrypting the file (Declaration of Independence).</p>
