A PHP Error was encountered

Severity: Warning

Message: fopen(/var/cpanel/php/sessions/ea-php56/PHPSESSID7vvmroddb3ibjo45ba7q1nqu6ab3arto): failed to open stream: No space left on device

Filename: drivers/Session_files_driver.php

Line Number: 174

C++ program to use function as a LVALUE using reference variable
Q:

C++ program to use function as a LVALUE using reference variable

0

C++ program to use function as a LVALUE using reference variable

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

function as a LVALUE using reference variable example in C++

/*C++ program to use function as a LVALUE using reference 
variable.*/
 
#include  <iostream>
using namespace std;
 
int var ;
 
int& fun()
{
    return var;
}
 
int main()
{
    //Function used as LVALUE
    fun() = 10;
 
    cout << "Value of var : " << var << endl; 
 
    return 0;
}

Output

    Value of var : 10

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Most popular and Searched C++ solved programs with Explanation and Output

Similar questions


need a help?


find thousands of online teachers now
C++ program to demonstrate example of Inline Funct... >>
<< C++ program to demonstrate use of reference variab...

A PHP Error was encountered

Severity: Warning

Message: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/cpanel/php/sessions/ea-php56)

Filename: Unknown

Line Number: 0