Thursday, May 21, 2020

References in C++

  • Program :
#include <iostream>
#include <string>
using namespace std;
int main(){
  cout <<"\n----------------REFERENCES----------------\n";
  cout <<"\n----------------Creating References----------------\n";
  string food = "Pizza";
  string &meal = food;
  cout << food << "\n";
  cout << meal << "\n";
 
  cout <<"\n----------------Memory Address----------------\n";
  string dish = "Briyani";
  cout << &dish;
  return 0;
}

  • Output :


No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...