1 | initial version |
First of all, I am seeing that you are using the old C-style API. If you haven't go tons of experience with programming in C, it is the ideal place to get nullpointer exceptions. Basically this is caused by dangling pointers (pointers that refer to nothing or empty memory).
If you however, do not mind to go to C++, take a look at this guide. It is way more clear then your code and will get you setup pretty fast.
As for your problem, could you indicate the exact location in your code of where the debugging points you too?