ifstream으로 string객체에 line단위로 읽어오기...
글쓴이: purewell / 작성시간: 금, 2003/04/11 - 4:10오후
... ifstream ifs("hello.txt"); char buff[256]; ifs.geline(buff, 256); ...
위에서 쓰인 "char buffer[256]" 대신 std::string객체를 쓸 수 있는
방법 있나요? ㅡ_-)/ string객체로 읽어오면 크기 생각 안 하고 읽어도
될 것 같아서요... 물론...
... string strbuffer; ifs >> strbuffer; ...
이래도 되지만, 라인단위로 읽어오는 것이 아니라
white-space를 구분자로 해서 읽어오잖아요.
방법이 없을까요?
Forums:
[code:1]int main(){ ifs
이렇게 쓰면 되는것 같은데요..
흠....
댓글 달기