cancel
Showing results for 
Search instead for 
Did you mean: 

structures

ASSAAD.ASSAAD
Associate II

Hello All , I am sorry it might be the wrong forum ,

i use STM32f429 with TFT to create a menu system

I am declare a structures for menu but i dont have success to put a structure in side a struture

could me what is wrong ?

 struct menu_type 

{

char  *title;

unsigned char type;

uint16_t  rec_xpos; 

uint16_t  rec_ypos; 

uint16_t  rec_width; 

uint16_t  rec_high; 

unsigned int num_items ;

char* items [ 100] ; 

void (*nag_ok)();

void (*nag_right)();

void (*nag_left)();

void (*command)();

};

//--

struct menu_main 

{

struct menu_type submenus;

};

how can I pass the variables to menu_main ?

Thank you all

2 REPLIES 2

Yes, this is definitely the wrong forum. I'd suggest an introduction-to-C-programming forum to learn the basics of the language.

>>how can I pass the variables to menu_main ?

Not even sure what the question is actually asking.

How do you initialize said structure? Is that what you're asking?

Or how to assign values?

foo.submenus.title = "Some Title";

I prefer to use "typedef struct _xyz {} xyz;" form.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..