How to create a reference variable in C++

Answer Posted / hrpynux@gmail.com

When a variable is declared as a reference, it becomes an alternative name for an existing variable. A variable can be declared as a reference by putting '&' in the declaration.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do we have to use initialization list in spite of the assignment in constructors?

565


How do you add an element to a set in c++?

551


why is iostream::eof inside a loop condition considered wrong?

593


What is the use of 'using' declaration in c++?

628


Why do we need function?

597






When one must use recursion function? Mention what happens when recursion functions are declared inline?

649


What is c strings syntax?

610


Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?

637


What is a set in c++?

531


Explain register storage specifier.

592


Can we use this pointer in a class specific, operator-overloading function for new operator?

613


What are static member functions?

616


Which c++ operator cannot overload?

550


What are friend classes? What are advantages of using friend classes?

608


What are the various operations performed on stack?

629