Wednesday, October 17, 2012

Some C++ :p



Read content of file to stringstream


int main()
{
    std::ifstream file( "myFile" );

    if ( file )
    {
        std::stringstream buffer;

        buffer << file.rdbuf();

        file.close();

        // operations on the buffer...
    }
}

No comments:

Post a Comment

I would be glad to know if this post helped you.