Sunday 15 May 2011

c - The #define variable usage -


I am working on a project written in the C programming language. I found a code snippet below

  unsigned letters [10]; #define arr () (& amp; value [0])   

How have they defined "function" ( arr () ) # Define the variable for an unsigned four array?

They are trying to use variables such as arr () [1], arr () [2] etc.

  1. arr () + 2 is equal to value + 2 . I tried to run a small program, but due to two results I got different answers. How is this possible. Because they are telling the address of the first array on arr () . Should not these two be equal? Can anyone explain what is the significance of defining a variable as above?

    I can not tell you why they did it, but yes, arr () + 2 and value + 2 are the same thing.

No comments:

Post a Comment