   Visual Studio unhandled exception
  Hi, i'm getting a weird error when i try to close the app i have written. In a nutshell what my program does is fire a firework vertically then when it reaches a certain height it creates 10 firework particles which explode out in random directions/speeds. This works fine but upon exiting the app i get the following unhandled exception:"Unhandled exception at 0x004140bd in firework.exe: 0xC0000005: Access violation reading location 0x442b4290."The error is pointing to _piob in fflush.c. I have no idea what this is, anyone able to tell me what an error with this variable means?Thanks   
  You've got memory corruption somewhere, possibly in a destructor (assuming C++). Can't tell you much more than that without seeing the code.   ;  ok thanks, i'm writing in C. what sort of thing could cause memory corruption? trying to write beyond an array?edit: if i try and create 5 explosion particles instead of 10 i don't get this error. strange   