1.

Which operator is having the right to left associativity in the following?(a) Array subscripting(b) Function call(c) Addition and subtraction(d) Type castThis question was posed to me in an interview for job.I need to ask this question from Operators topic in division Functions, Namespaces & Exceptions in C++ of C++

Answer»

Right answer is (d) Type cast

The EXPLANATION: There are many rights to left associativity operators in C++, which MEANS they are evaluation is done from right to left. Type Cast is ONE of them. Here is a LINK of the associativity of operators: https://github.com/MicrosoftDocs/cpp-docs/blob/master/docs/cpp/cpp-built-in-operators-precedence-and-associativity.md



Discussion

No Comment Found

Related InterviewSolutions