reading a text file in c++

hello all ,
im trying to read a text file and display its contents. While i got the code running and the output was displayed perfectly for sometime , i started getting Abort(core dump) error . Am i missing something here ? im using HP-UX.

#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
#include <string.h>



int main () {
  int length;
  char* buff=NULL;

  ifstream is;
  is.open ("vishy.txt", ios::in );

  // get length of file:
  is.seekg (0, ios::end);
  length = is.tellg();
  is.seekg (0, ios::beg);

  // allocate memory:

  buff = new char [length];
  // read data as a block:
  is.read (buff,length);
  is.close();

  cout.write (buff,length);
  delete[] buff;
  buff = NULL;
 
}

thanks
vishy

i started getting Abort(core dump) error 

Process has received a fatal signal, which has caused it to terminate and dump core. Probably, the program called the abort() function, which causes it to send SIGABORT to itself.

Am i missing something here?

Try to debug your code using gdb.