• Advertisement


This topic is now archived and is closed to further replies.

TurboC array/pointer problem

This topic is 5390 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have a biiiiig problem with TurboC.Say i''m doing this:

//bla bla bla includes

char far *buff = new char[320 * 200];

void main(void)
  int i,j;

    int x = rand() % 320;
    int y = rand() % 200;

    long addr = (long)y * 320 + x;

    buff[addr] = 50;
  delete [] buff;

and that''s either bug the probram or crash it.And it''s happening with absolutely every array i allocate.As soon as i try to initialize a array element with value different than 0 the program crashes.Do somebody know a solution to that problem? "You losers better learn...NOONE CONTROLS OUR GOD DAMN LIFE!!!" - MANOWAR

Share this post

Link to post
Share on other sites

  • Advertisement