1

Is this a valid assignment?

 #define   thing      _U_(0x8)   

Is there any assumption on "U" or not? Should it be a union for example?

Also what is the meaning of (0x8)?

Thanks!

Sad Hem
  • 11
  • 2
  • 1st this is not an assignment; 2nd `_U_` is reserved for any use (thanks @user3386109) – pmg Jun 17 '19 at 18:02
  • 4
    From the C standard: *"All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use."* – user3386109 Jun 17 '19 at 18:03
  • 3
    "*Is there any assumption on "U" or not?*" -- The C language has no form of implicit typing. The spelling of an identifier says nothing about the type of the thing it identifies. There may, however, be local conventions along those lines. – John Bollinger Jun 17 '19 at 18:06
  • Thanks all. The (0x8) means it is an 8-bit data variable, or the value of U is zero? – Sad Hem Jun 17 '19 at 18:17
  • `0x8` is a hexadecimal literal. In this specific case it is exactly the same as if you wrote `8` there. Beyond that, it's impossible to know what that number represents without more information. – Daniel Pryden Jun 17 '19 at 18:27
  • @DanielPryden I know what hexadecimal is! My question is about what U(8) means but I get your point on lack of sufficient context. – Sad Hem Jun 17 '19 at 18:49
  • @user3386109 I do not know what is the benefit of marking my question as "duplicate", without showing where exactly it was asked before. be professional pls. – Sad Hem Jun 17 '19 at 18:50
  • @SadHem Not sure what you mean. Did you click on the link in the big yellow box above the question? – user3386109 Jun 17 '19 at 18:53
  • I see that now! I am new to this website ;) thanks. – Sad Hem Jun 17 '19 at 18:57
  • is `_U_` a type or macro defined elsewhere? – Christian Gibbons Jun 17 '19 at 19:41
  • `_U_` is not anything special. It's something defined by the program, the same as if it was `DoStuff(0x8)`. Find where `_U_` is defined, and that is the definition. – user253751 Jun 18 '19 at 00:39

0 Answers0