ALGORITHM FOR RESOLVING C DECLARATION
OPERATORS: * & () [] , PRECEDENCE (DECREASING ORDER): () [] * & , ASSOCIATIVITY (POSTFIX): () [] ASSOCIATIVITY (PREFIX): * & Meaning: [] : array of () : function taking ... and returning * : pointer to & : reference to {address of} , : and
1. FIND THE IDENTIFIER 2. RESOLVE THE OPERATORS ON THE RIGHT. EG: () , [] IF () THEN RESOLVE THE FUNCTION ARGUMENTS 3. RESOLVE OPERATORS (EG: *) and TYPES ON THE LEFT 4. REPEAT 2 & 3 TILL NOTHING LEFT UNRESOLVEDFew Examples Of Resolving Complex Declaration. References: Clockwise Spiral Rule
No comments:
Post a Comment