Question about getline with fstream

  • Thread starter Thread starter yungman
  • Start date Start date
Click For Summary
The discussion focuses on the use of `getline` with `fstream` in C++, highlighting the differences between reading into a string and an array. The user experiences compile errors when using `dataF.getline` with a string, while `getline(dataF, Crstr)` works correctly. Additionally, confusion arises regarding the behavior of `seekg` when reading from a file, particularly how the file pointer advances after reading. Explanations clarify that the pointer moves to the next character after a read operation, and the user learns about the importance of correctly using offsets with `seekg`. Overall, the conversation emphasizes the nuances of file handling in C++ and the need for understanding function specifications.
  • #61
phinds said:
You set a TIME goal. Why not set a LEARNING goal instead?

A time goal without a learning goal can be met just by waiting.
 
  • Like
Likes sysprog
Technology news on Phys.org
  • #62
Vanadium 50 said:
A time goal without a learning goal can be met just by waiting.
Yeah, but he's setting very brief time goals.
 
  • #63
All the faster. :wink:
 
  • Haha
Likes phinds
  • #64
There's the old line "I took a speed-reading class and was able to read War & Peace in twenty minutes. It's about Russia."
 
  • Haha
Likes sysprog
  • #65
Vanadium 50 said:
There's the old line "I took a speed-reading class and was able to read War & Peace in twenty minutes. It's about Russia."
Reminds me of:
1601298941329.png
 
  • Haha
Likes sysprog
  • #66
The question about how file input works has been beaten to death, so this seems like a good place to end the thread.
 

Similar threads

  • · Replies 32 ·
2
Replies
32
Views
3K
Replies
6
Views
1K
  • · Replies 70 ·
3
Replies
70
Views
5K
  • · Replies 118 ·
4
Replies
118
Views
9K
Replies
20
Views
2K
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 33 ·
2
Replies
33
Views
3K
Replies
10
Views
2K