Data corruption

This is a discussion on Data corruption within the C++ Programming forums, part of the General Programming Boards category; Hello!
I have come to a weird problem. My data seems to corrupt somehow with a little piece of code ...

This bit of code corrupts data. It always seems to corrupt a certain data, but when I changed some code(not that piece of code) it started corrupting entirely different data.
My variable which should be 112 changes into something like 78590343 and before a char value "test" changed into "-|>*".

I have absolutely no idea what do do. The Texture loading code should use the right data, I checked it.

This bit of code corrupts data. It always seems to corrupt a certain data, but when I changed some code(not that piece of code) it started corrupting entirely different data.
My variable which should be 112 changes into something like 78590343 and before a char value "test" changed into "-|>*".

I have absolutely no idea what do do. The Texture loading code should use the right data, I checked it.

Well, "your variable" (you didn't say which one) obviously is getting set to a value that is not correct. Run your program through a debugger, set breakpoints, or put in printf() statement to watch it as it is changed.

There's no need to name the variable as it isn't used in that code anyway. I have already debugged and I have no idea why it changes there. It seems to have no logical connection. I have never had such problem before. There is nothing that changes that variable there, although I've detected (with the help of debugging) that it changes there.

How can the variable change if there is nothing that affects that variable?

How can the variable change if there is nothing that affects that variable?

I suspect your code is broken somewhere, and your variable is getting clobbered by it. So, to state that nothing is affecting it is probably an incorrect assumption on your part, unless your code is just wrong to start with, but I'm giving you the benefit of doubt in that regard.

If you're certain this line (with this value of i) changes some other variable: then either render_info[2] doesn't exist or Texture[2] doesn't exist. My bet would be the latter, since that's where the texture is supposed to be written to -- if there's not a valid texture variable there you're going to trash some memory.