1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

struct and varialbe

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

  1. zu1u

    zu1u New Member

    Joined:
    Sep 3, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    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

    Code:
    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