imxrt1020 mcuxpresso "blinky iled

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imxrt1020 mcuxpresso "blinky iled

1,225 Views
champ
Contributor I

Could someone explain what is 0U,1U,2U,3U,4U,5U in the picture means? Thank you3.PNG

0 Kudos
3 Replies

1,220 Views
champ
Contributor I

Thank you! I understand unsigned/sign. Could you explain what line 39 and 40 does? 

0 Kudos

1,210 Views
ErichStyger
Senior Contributor V

they assign numerical values to the enumeration. By default enumerations start in C/C++ with 0, then 1, and so on. So all what this does here is to use unsigned values instead of signed (by default, enums are signed).

0 Kudos

1,222 Views
ErichStyger
Senior Contributor V

In C and C++, any immediate number (0, 1, 2, ...) is of type int, and 'int' is signed.

By adding the 'U' suffix you get an unsigned number, so 0U is zero with type 'unsigned'.

Just plain C/C++ programming

0 Kudos