Public feed #724684

Untitled

public text v1 · immutable
Raw Edit
·published 2007-10-03 19:55 UTC
rendered paste body
#include <cstdlib>
#include <iostream>
#include <stdlib.h>
#include <ios>
#include <assert.h>
#include <fstream>

using namespace std;

int main(int argc, char *argv[])
{
    ifstream bmp1;
    bmp1.open("hola.bmp");
    
    filebuf *proBMP;
    proBMP = bmp1.rdbuf();
    
    char * pBMP;

  // allocate memory to contain file data
  buffer=new char[size];

  // get file data  
  pbuf->sgetn (buffer,size);

  filestr.close();

  // write content to stdout
  cout.write (buffer,size);


    char temp;
    bmp1 >> temp;
    assert(temp == 'B');
    bmp1 >> temp;
    assert(temp == 'M');
    
    int tam;
    bmp1 >> tam;
    assert(tam > 58);
       
    
             
    system("PAUSE");
    return EXIT_SUCCESS;
}