if you want tot read 'length' bytes into the char* you must allocated length + 1 bytes. +1 is for \'0' that compiler adds automatically.
char* t = new char[ length + 1 ];
in.read( t, length );