> However, after compiling it in Turbo C++ 3.0 and then running it
Check which memory model you compiled with - if it's small / tiny / compact?, then you've got a max possible allocation (for all your data) of 64K.

I've also heard that a program running within the IDE has a lot less memory to play with than a normal .exe would have.

> screen = (unsigned char *)malloc(64000);
There is no prototype for malloc in scope, so who know's how that 64000 is being mangled by 16 bit arithmetic.

Is there some smaller value for memory size (say 20000) which works (for testing etc).