Passed by value-result is aliases, result will be same with pass by reference code example

Example: Passed by value-result is aliases, result will be same with pass by reference

Person p, q;
  p = new Person();
  q = p;
  // now p.name and q.name are aliases (they both refer to the same location)
  // however, p and q are not aliases (they refer to different locations)

pictorially:

                   +--------------------------------+
                   |                                |
                   |       +---------------------+  |
                   |       |                     |  |
                   |       |                     v  v
           ---     |       |                    +---+
        p: |-|-----+       |              name: |   |  a Person object
           ---             |                    |---|
                           |               age: |   |
           ---             |                    +---+
        q: |-|-------------+
           ---

Tags:

C Example