Jump to content
  • Advertisement

Archived

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

Mihail121

TurboC array/pointer problem

This topic is 5573 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;

  while(!kbhit())
  {
    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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!