Yeah - there's so many ways of doing it, but none of them are particularly easy to implement.
Really, this is one you should figure out yourself; I don't know, I've never done it myself, but it sounds like a good system to code just for learning purposes.
Elaborating on what RPGamer said, arrays are certainly the way to go - you'ld need an array of size equal to the maximum storage space in your inventory (assuming each item takes up the same amount of space) and, as the user collects items, find a free spot in the inventory array and fill it with a number that corresponds to that particular item. Your visual display would then look through this array and pick out what item is in each inventory slot, displaying an appropriate sprite somewhere on the screen.
As for using inventory, you would let the user select the item in some manner, and then designate the slot that the item is in as the 'active slot' or something. When the user then uses the item on some other object, your program would check what the object in question is, what slot is currently the active slot and what item is in it, and whether the item and object can be used together. After that, you would probably want to set the active slot to a null value or something (-1 is usually a good idea), to effectively deselect the inventory item.
Sorry to be long winded, but this should hopefully give you the insight needed to solve your problem. If not, I'm just a fool.
"I am a living, thinking entity who was created in the sea of information."