Reference Variable

Reference Variable act as Pointer like function we work in C programming.  

/*Reference Variable: Data type and VariableName*/

#include<iostream>

using namespace std;

void display(int& a){

a=667;

}

int main(){

int b;

display(b);

cout<<b;

return 0;}



This is Similar to the Function

void display(int *a) {
*a=67;}
display(&b);

0 Comments had been done yet:

Post a Comment