Reference in C++

 

#include <iostream>

using namespace std;

int main()

{

    int a=10;

    int &b=a;// &b is the reference of a

    //now a&b will be the same address of value 10

    //example

    cout<<b<<endl;

}

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top