the problem is in the LoadGraphic method:

LoadGraphic(char *filename) //LoadGraphic function, loads a
{
>>> char *temp = ""; <<<

allocate enought space before e.g.\
>>> char...