Hello guys, Simon again:

after solving one week Problems at my self, there's one wich makes me sleepless nights...
... I try to code an inventory System - included with an item System.
It's in the beginning. Please read this code and tell me why the engine tells my while pressing 't' "Engine Error in "give_item""
Code:
//includes
...

typedef struct ITEM
{
   int it_id;
   BMAP* it_bmap;
} ITEM;

ITEM* item_001 = malloc(sizeof(ITEM));
   item_001.it_id = 001;
   item_001.it_id = "item_001.png";

give_item()
{
   pan_inventory_slot.bmap = item_001.bmap;
}

void main()
{
   //Level and Game initalizing
   ...
   
   on_t = give_item;
}



Thanks for your help, maybe you can send me the link to an complete tutorial i Need to understand this? :-)

EDIT:

One more question:
Is it possible to give a struct pointer as Parameter to a function?

Last edited by Simon_Schwitzky; 03/25/14 17:45.

Die Menschen, die verrückt genug sind zu sagen, dass sie die Welt verändern werden, sind diejenigen, die es tuen!
-Steve Jobs