Hi, using pointers in Lite-C is pretty easy. I assume you have worked through the Lite-C workshop.
1) You can call a function from anywhere. All you have to do is create a new function with the code you want to call, give it a useful name and call it.
void main()
{
beep(); // make the engine 'beep'.
}
The above code using a seperate function...
void CallBeep()
{
beep();
}
void main()
{
CallBeep();
}
This is a useless example but shows you that you can break any code in various functions. This is called modular programming.
2) The reason the 'ent_remove(enemy);' call crashes is because the 'enemy' pointer is NULL. Removing a NULL pointer results in a crash. Make sure that 'enemy' isn't being removed already.