vague lvalue vs rvalue question

Discussion in 'C Programming' started by Chad, Apr 16, 2008.

  1. Chad

    Chad Guest

    The following question actually stems from an old Chris Torek post.

    And I quote from the following old CLC url

    http://groups.google.com/group/comp...t&q=convert lvalue to rvalue#cfeed3fda1d0ee46

    "Mathematically speaking, unary `&' and `*' are inverse functions.
    Unary `&' takes an lvalue of type `T' and produces an rvalue of
    type `pointer to T'; unary `*' takes an rvalue of type `pointer to
    T' and produces an lvalue of type `T'. The <value, type> pairs
    from unary `&' must be distinct for distinct lvalues [*], and there
    may be only one value produced for any particular lvalue. This
    makes it an invertible function; `*' is then defined as the inverse
    function. While `*' is a well-behaved function on conventional
    architectures, all that the language requires is that it be the
    inverse of `&'. "

    I don't see how one is the inverse of the other. Can someone provide a
    concrete example?


    Chad
    Chad, Apr 16, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Mantoulidis

    ++x returns lvalue but x++ return rvalue

    Chris Mantoulidis, Dec 28, 2003, in forum: C++
    Replies:
    4
    Views:
    488
    Chris Mantoulidis
    Dec 29, 2003
  2. Gonzalo Aguirre

    rvalue / lvalue operator[]

    Gonzalo Aguirre, Jan 2, 2004, in forum: C++
    Replies:
    4
    Views:
    438
    Ron Natalie
    Jan 2, 2004
  3. Denis Remezov

    lvalue rvalue

    Denis Remezov, Jul 16, 2004, in forum: C++
    Replies:
    12
    Views:
    831
  4. Kavya
    Replies:
    9
    Views:
    495
    Dik T. Winter
    Oct 28, 2006
  5. Juha Nieminen
    Replies:
    13
    Views:
    600
    Edek Pienkowski
    Aug 29, 2012
Loading...

Share This Page