From: Luke D. <cod...@ho...> - 2002-07-08 06:08:32
|
Have you tried stepping through the program in GDB or just printing the variables in many places in the code? I'm sure you know that this is a very common problem and is almost certainly a bug in your code. You can upload the program if you have tried everything else. Luke Dunstan ----- Original Message ----- From: "Philip Bock" <ph...@fl...> To: <min...@li...> Sent: Monday, July 08, 2002 1:54 PM Subject: [Mingw-users] Variables changing values strangely > I'm having a strange problem with a program, and I don't know if it's MinGW > specific, but I'll ask in this list anyway. In my program, a certain > function creates an instance of a certain struct, using new. It then passes > a pointer to this struct back, and it gets passed around for a while. Then, > a different function sets some members of the struct, and outputs a message > saying what it set them to. Later, a third function is supposed to use these > values, but by the time it gets called, they've changed! I've looked through > the whole program, and this is the last place these variables get set. So, > my question is, is there any way these variables could change without me > changing them? > > I would post some code, but unfortunately, there's no simple example that > demonstrates this problem that I know of. I can upload the entire program to > a server if anyone thinks that will help. I know this doesn't give anyone > very much to go on, and I won't be surprised if know one can help me, but > I've run out of ideas for things to try. > > Thanks, Philip Bock |