Composition
Further information: Pointer: Multiple indirectionThe unary * operator, as defined in C and C++, can be used in compositions in cases of multiple indirection, where multiple acts of dereferencing are required. Pointers can of course reference other pointers, and in such cases, multiple applications of the dereference operator are needed. Similarly, the Java dot operator can be used in compositions forming quite sophisticated statements that require substantial dereferencing of pointers behind the scenes during evaluation.
A basic example is in the argv argument to the main function in C (and C++), which is given in the prototype as char **argv – this is because the variable argv itself is a pointer to an array of strings (an array of arrays), so *argv is a pointer to the 0th string (by convention the name of the program), and **argv is the 0th character of the 0th string.
Read more about this topic: Dereference Operator
Famous quotes containing the word composition:
“There was not a grain of poetry in the whole composition of Lord Fawn, and poetry was what her very soul craved;Mpoetry, together with houses, champagne, jewels, and admiration.”
—Anthony Trollope (18151882)
“The proposed Constitution ... is, in strictness, neither a national nor a federal constitution; but a composition of both.”
—James Madison (17511836)
“The composition of a tragedy requires testicles.”
—Voltaire [François Marie Arouet] (16941778)