struct and varialbe

Discussion in 'C' started by zu1u, Sep 3, 2010.

  1. zu1u

    zu1u New Member

    Sep 3, 2010
    Likes Received:
    Trophy Points:
    I'm not very used to the C syntax, so I'm having this probably rather easy to solve problem for someone with experience.
    I have a struct that is of the form

    typedef struct MyStruct{
    uint32_t myVar:2;
    } MyStruct;
    As far as I know the :2 means that I have a myVar that has actually a width of two unit32_t. Is that correct?
    Question is, how how can I assign values to one of the 2 single instances of uint32_t?

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice