I some code i was trying to debug i had the lines:
Which does not over the entire lenth of the string (char str[50]; )Code:objfile.getline(str,10); cout << str <<endl; objfile.getline(str,10); cout << str <<endl;
I was testing to see if getline would either put out the same string twice or would automaticly carry down weather or not it reached the and of the string or not, however...
The output was neither, insted it only puts out the 1st 10 chars and then a carrage return
then is blank and carrage returns again.
Why does it clear str insted of filling it with text the 2nd time if the end of string wasn't reached in the 1st?