Jump to content
  • Advertisement


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


TurboC array/pointer problem

This topic is 5655 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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!