title: C++ - Does getline have a maximum string or character capacity?
body: <p>My question is in reference to an assignment that I am working on. It seems like there are multiple ways to approach the assignment. </p>
  
  <p>The program I am writing will be a filter for text files. The purpose of the assignment is to get experience with fstream and getline.</p>
  
  <p>Requirements:</p>
  
  <ol>
  <li>Read one text file (any way possible, doesn't have to be all at once)</li>
  <li>Write to a separate text file (any way possible, can append or write character by character)</li>
  <li>It is assumed each sentence ends with a period.</li>
  <li>The first letter of each sentence must be uppercase.</li>
  <li>Everything besides the first letter of each sentence must be lowercase. (proper nouns too - it's a trivial example)</li>
  </ol>
  
  <p>I have a working draft of a program that I have written, but getline has is inconsistent in how it is reading my text file. Basically, it will read one line in as a string, which is what I want. As it reads in the second line; however, the program throws a runtime error halfway through the line and Windows shuts it down.</p>
  
  <p>Does getline have a buffer that fills up and needs to cleaned after each line read? </p>
  
  <p>My pseudo code for the program:</p>
  
  <ol>
  <li>Use getline to read in string from line x stopping at a period (.).</li>
  <li>Iterate over strings characters, uppercasing the first letter, and then lowercasing the rest.</li>
  <li>Read in another string continuing after the last period (.) in the text file.</li>
  <li>Repeat until text file read.</li>
  <li>Write to second text file.</li>
  </ol>
  
  <p>I am implementing getline this way:</p>
  
  <pre><code>getline(fileIN, str1, '.')
  </code></pre>
  
  <p>str1 is the string that is read from each line.</p>
  
  <p>Am I using getline correctly? Am I thinking this problem through correctly and efficiently?</p>
  
  <p><em>*</em> I realized as I was finishing this extended question/section that getline may be utilizing more memory for '\r' or '\n' characters at the ends of lines, or for reasons unrelated to memory, getline is not correctly handling (according to my purposes) sentences that wrap to new lines. Does getline not handle sentence/word wrap well?</p>
  
  <p>Also, is there a way to dynamically specify getline to read the first string up to a period (.) or newline ('\n'), which ever comes FIRST?</p>
  
  <p>Thank you for your time and consideration.</p>