STL 이용하여 파일의 내용 한줄씩 읽어오기 - std::getline(...)
Posted 2009/04/21 16:07|
|
|
댓글 하나가 운영자에겐 커다란 힘이 됩니다!
istream& getline ( istream& is, string& str, char delim ); |
Get line from stream
Extracts characters from is and stores them into str until a delimitation character is found.The delimiter character is delim for the first function version, and '\n' (newline character) for the second. The extraction also stops if the end of file is reached in is or if some other error occurs during the input operation.
If the delimiter is found, it is extracted and discarded, i.e. it is not stored and the next input operation will begin after it.
Notice that unlike the c-string versions of istream::getline, these string versions are implemented as global functions instead of members of the stream class.
자세히 보기
예>
위의 정보가 도움이 되셨나요? 그렇다면 댓글 하나만 남겨주세요.
댓글 하나가 운영자에겐 커다란 힘이 됩니다!
- Filed under : 프로그래밍/C & Cpp
- 1 Comment Trackback


LegendFinger
| 2009/04/30 18:55 | PERMALINK | EDIT | REPLY |좋은정보감사^^ 펌감니다