SFML community forums
Help => General => Topic started by: Geoffry_the_Deprogrammer on November 23, 2014, 01:31:08 am
-
I am attempting to pass a integer variable into another class, and get it to increase on a condition, the code itself doesn't seem to have any problem, until I run the program, at which point I am met with the error "Object reference not set to an instance of an object" does anyone know what I might be doing wrong...?
-
Sharing is caring (Please provide a complete and minimal code).
-
is this sufficient...?
if (correctLetter1 == true)
{
game.GatesCleared += 1;
}
-
That's not exactly complete code. Complete code is code that can be copied, pasted, and compiled without modification. See this information (http://en.sfml-dev.org/forums/index.php?topic=5559.msg36368#msg36368).
Also, doing this, which you should have already done (http://bit.ly/UA4tt9), I found this:
When ever you try to retrieve data from a Null object you will get this error. Before retrieving the data from any object check for NULL.
Does it help at all?
-
yeah, im not entirely sure what is and is not required... last time i posted a question i added too much code... im not sure how to gauge how much I need to show... none of my variables are null... im not entirely sure what the error message im getting actually means, even after hours of searching on the internet... i cant figure out what the error is...
-
im not entirely sure what is and is not required...im not sure how to gauge how much I need to show
When it comes to complete and minimal code, complete means that it should be easily copied, pasted, and compiled by others to test it, and minimal means that it should be code that only what is necessary to create the error. If something doesn't cause this error, it's irrelevant to the post and shouldn't be in the example code.
-
This forum is about SFML, not about programming languages.
Please use a different platform (StackOverflow, C# forum) for language-specific questions that have nothing to do with SFML.