Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assigning literal 0 to an unsigned variable
#4
That is correct - the initialiser must have an unsigned type and a 'U' suffix is a neat way to do this for literals.

There are other ways of achieving the same effect too, for example:
Code:
unsigned u = (unsigned)0;
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)