pointer to data member

Discussion in 'C Programming' started by fluteofcoder, Mar 5, 2011.

  1. fluteofcoder

    fluteofcoder

    Joined:
    Mar 4, 2011
    Messages:
    2
    Code:
    class x
    {
    public:
    int i;
    }
    int main()
    {
    //legal syntax
    int x::*ptr=&x::i;
    
    But this syantax is illegal >> int x::*ptr=&(x::i); since i aint static member so i want to know
    how actually & and :: operator binds in the expression>>&x::i
     
    fluteofcoder, Mar 5, 2011
    #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. Fraser Ross
    Replies:
    4
    Views:
    1,093
    Fraser Ross
    Aug 14, 2004
  2. Jason
    Replies:
    2
    Views:
    554
    Jonathan Mcdougall
    May 13, 2006
  3. Stephen Howe
    Replies:
    2
    Views:
    305
    Stephen Howe
    Nov 6, 2012
  4. somenath
    Replies:
    10
    Views:
    309
    James Kanze
    Jul 2, 2013
  5. somenath
    Replies:
    2
    Views:
    177
    somenath
    Aug 29, 2013
Loading...

Share This Page