HerbertMunch
New Member
Hi im trying to get a pointer to point at an array. Heres my code.
typedefs
The currentLevel->items array begins at memory location 0x83. however when i set the *item pointer = currentLevel->items, it actaullly points at 0xD0!
any ideas on what im doing wrong?
Many thanks.
typedefs
Code:
typedef unsigned char bool;
//represents an individual menu item which belongs to a menu level
typedef rom struct MenuItem
{
//bool. describes whether or not this node is a top level node.
//i.e when MenuClick() is called on this item, topLevelHandler will be called
//and the current item will be stored in history
char topLevel;
//Pointer to an array of characters representing the menu item
near rom char *text;
//A pointer which points to the next level up in the menu heirarchy
//Actually a MenuLevel pointer.
near rom *subMenu;
//Pointer to handler method that deals with the application specifics.
void (*topLevelHandler)(void);
}MenuItem;
//represents a level of menu heirarchy.
typedef rom struct MenuLevel
{
//The index of the current selected menu on this level
char currentIndex;
//The length of the item array specified by *items
bool itemCount;
//Pointer to an array of menu items that represent this level
rom MenuItem *items;
}MenuLevel;
Code:
//Pointer to the current menu level
struct MenuLevel *currentLevel;
MenuItem *item = currentLevel->items;
The currentLevel->items array begins at memory location 0x83. however when i set the *item pointer = currentLevel->items, it actaullly points at 0xD0!
any ideas on what im doing wrong?
Many thanks.