Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
678 views
in Information Technology by (106k points)
closed by
Which of the following is TRUE with respect to a Reference?
1. A reference can never be NULL
2. A reference needs an explicit dereferencing mechanism
3. A reference can be reassigned after it is established
4. A reference and pointer are synonymous

1 Answer

0 votes
by (106k points)
selected by
 
Best answer
Correct Answer - Option 1 : A reference can never be NULL

The correct answer is "option 1".

The reference is used to refer to an existing variable in an alternative name.

Syntax: DataType &newname = current name

EXPLANATION:

Option 1: TRUE

A pointer can have a NULL value but a reference cannot have.

Option 2: FALSE

A reference doesn't need any explicitly dereferencing mechanism.

Option 3: FALSE

A reference can't reassign since a reference can't refer to another object once the reference is created.

Option 4: FALSE

Reference & pointers are not synonymous.

Reference is used to refer to an existing variable in an alternative name while pointers are used to store the address of a variable.

Hence, the correct answer is "option 1".

The syntax for a pointer is:

Syntax: DataType *pointer;

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...