Pick the correct statement about references in C++.a)References stores...
Explanation:
In C programming language, references are not directly available like in C++. However, there are ways to achieve similar functionality using pointers. Let's discuss each option and determine the correct statement.
a) References store the address of variables:
This statement is incorrect. In C, references are not a built-in feature, and therefore they do not exist. Instead, pointers are used to store the address of variables.
b) References and variables both have the same address:
This statement is correct. In C, when a pointer is assigned the address of a variable, the pointer and the variable will have the same address. This allows the pointer to indirectly access and modify the value of the variable.
c) References use dereferencing operator(*) to access the value of the variable it's referencing:
This statement is incorrect. In C, to access the value of a variable through a pointer, the dereferencing operator (*) is used. However, since references are not available in C, this statement does not apply.
d) References were also available in C:
This statement is incorrect. References were introduced in C++ and are not available in the C programming language.
Therefore, the correct statement is option b) References and variables both have the same address. This statement reflects the behavior of pointers in C, where a pointer stores the address of a variable, and both the pointer and the variable have the same address.
Pick the correct statement about references in C++.a)References stores...
References and variable it is referring to shares the same address. References do not consume extra address. References do not store the address of other variables. No dereferencing operator required while using references. References are not available in C++.
To make sure you are not studying endlessly, EduRev has designed Class 7 study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Class 7.