Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C++
enum xyz
{
  a, 
  b, 
  c
};

int main()
{
  int x = a, y = b, z = c;
  int &p = x, &q = y, &r = z;

  p = z;
  p = ++q;
  q = ++p;
  z = ++q + p++;

  cout<< p << " " <<; q << " " << z;

  return 0;
}


What I have tried:

---
Posted
Updated 13-Mar-18 21:58pm
v2
Comments
CPallini 14-Mar-18 4:06am    
You have lost your C++ manual, don't you?

The code uses Reference declaration - cppreference.com[^]. It is a basic C++ language feature that does not exist in C. See also Standard C++: References[^].
 
Share this answer
 
Comments
CPallini 14-Mar-18 4:05am    
5.
Richard MacCutchan 14-Mar-18 4:07am    
And just to confuse us all it is also the addressof operator. :(
PJ Arends 14-Mar-18 19:31pm    
And also the bitwise AND operator.
There is nothing mysterious about that code... All you have to do to understand it is run it via your debugger line-by-line, command-by-command...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900