Skip to main content
ASSAAD.ASSAAD
Associate III
August 20, 2018
Question

structures

  • August 20, 2018
  • 2 replies
  • 874 views

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

    This topic has been closed for replies.

    2 replies

    David Littell
    Senior II
    August 20, 2018

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

    Tesla DeLorean
    Guru
    August 20, 2018

    >>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 (See Profile) Up vote any posts that you find helpful, it shows what's working..