1

If I declare:

int &y;
int *x;

x is of type "int *", but What is the type of variable y? Or does it not even make sense to ask that question?

David Berry
  • 40,941
  • 12
  • 84
  • 95
user5965026
  • 465
  • 5
  • 16

1 Answers1

0

This is a perfectly valid question. The type of variables is an int. However both use a different way of referencing the variable. According to standard nomenclature, in your case x is referred to as a pointer to an int. Whereas y is a reference to an int. Hope that helps.

siphr
  • 421
  • 4
  • 12
  • 1
    I would appreciate it if there was an explanation that would go along with the downvote. – siphr Feb 22 '16 at 20:56