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...
    }
}

1 comment:

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