Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Online game, coding problems.
#2
What do you use to program with?

I'm guessing the crash you're getting is related to memory access problems, since you're using a lot of array's and pointers. These are pretty easy to correct with a good debugger. Sadly, I can only help if you're using Visual Studio or Visual Express. I don't like Microsoft, but there debuggers are really easy to work with (and the sole reason why I use Visual Studio)

What you could try (if you're running something from MS):
- run the program inside the IDE
- force a crash. When it happens, you need to "debug and view the call stack" or something along those line. The stack contains all data at the moment of execution, and is the easiest way of catching your bug.
- if you're using Visual Express/Studio, it'll show all the variables in the stack and highlight where it went wrong. It always boils down to the same problem: a pointer is being used which points to some random location instead of the proper object.

This might be because the object it's supposed to point to A) never got created B) was created inside a function, without using "new" to reserve space on the stack (and thus it got destroyed when the function ended) C) got lost in translating pointers to references to pointers to references etc etc.

If you actually look at the stack at the moment of the crash, it should become clear which data is missing. Then you just track down where you create the troubled object (and in 99% of all cases, smack yourself against the head because you forgot to reserve space with "new")

If you're not using a debugger, put "cout << somenumber << endl;" every even/odd line to locate the exact moment stuff starts crashing.
Reply


Messages In This Thread
Online game, coding problems. - by Link - 06-19-2011, 10:36 AM
RE: Online game, coding problems. - by icecubemachines - 08-05-2011, 08:08 AM
RE: Online game, coding problems. - by haphazard - 09-14-2011, 08:07 PM
RE: Online game, coding problems. - by hacker - 09-14-2011, 08:34 PM
RE: Online game, coding problems. - by +Awesome - 09-18-2011, 01:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Looking to learn some sort of coding... Alowishus 10 2,259 10-28-2009, 05:30 AM
Last Post: IllusionSlayer
  Whats your Favorite coding program??? HuNt3R 28 4,314 10-19-2009, 06:55 PM
Last Post: HatredTrinity

Forum Jump:


Users browsing this thread: 1 Guest(s)