On one of my functions, I have declared an object. I access it again towards the end of the function. When I try to compile the code, it tells me the object has not been declared in the scope
What's weirder, if I try to minimise the entire function, it will cause and error and force me to terminate the program
I have counted all of the curly brackets because I thought this must be the error if it isn't detecting the object, but there are 48 opening brackets, and 48 closing brackets. Has anybody had a similar issue like this before? And how did you fix it?
Well debug comes up with no error, but it still won't access the value I'm trying to
I did initialise the object at the start by the way, I can access the object earlier in the code
I don't think I should post my code since it's so big, but while I'm waiting for responses I'll work on making it smaller
Well I think I found the issue why I can't access the object (I initialised the object inside a loop instead of the whole function), but it still doesn't explain why DevC++ is forcing a terminate when I try to minimise the function
Are you sure debug doesn't show problems? I very much doubt it. You use debug to track the variable and their values as you step throgh the code. If your program is crashing and you say debug doesn't show problems, then you aren't using debug properly.
Actually, making the code smaller is a good idea. By doing so it is a great chance that you find the real problem and don't even have to show us the code.
I think Peter87 has a valid point. My code is unnecessarily large because I'm just playing around as a newbie. I think I should put all my objects into an array so I can use for loops to go through the different functions which will get rid of the repeat lines, and if I can't find the problem then I'll make a new thread.
It's just that I have two separate issues at the moment. One is what the thread was initially about, DevC++ forcing me to terminate my project when I try to minimise the function, and the other is that my function causes my actual program to crash (which I thought was related but apparently isn't)
So they are different issues causing crashes of different things.
I should fix at least one of them first before I come to you guys