Write a program to intro to aliases, reference parameters in c++.
Alias is nothing but declaring an alternative name for a variable
we can use it in c++ by creating a reference variable to original variable
simple example:
int example, alias;
cout<<”Give the input”;
cin>>example;
alias=&example;
cout<<endl<<”Given input is”<<alias;
in the above code example is the original name we given to the variable, and alias is the alternative name we given to the variable.
That means we are creating a reference variable here.
we denote reference using the symbol "&"
so now we can access the variable using two names.
This is basic alias program in c++ using reference variable.
***please give a like if you are satisfied with the answer. if you have any doubts ask me through comments i will clear the doubts . THANK YOU! ***
Get Answers For Free
Most questions answered within 1 hours.