Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

What's a good solution to read a text file?

$
0
0

@cuinjune wrote:

I would like to simply read a text file and get the content as a std::string.

And I found out ofBuffer can do this.

ofBuffer buffer = ofBufferFromFile("someFile.txt"); // reading into the buffer 
std::string str = buffer.getText();

But I can’t really figure out how it works internally. Is this method fast enough to use?

Or is there a faster way to do the identical job?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles