checking object properties

Discussion in 'C' started by rahulmaximus, May 31, 2011.

  1. rahulmaximus

    rahulmaximus New Member

    Joined:
    May 31, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Hi
    I wanted to know if there is a way to check whether a particular object has a particular characteristics......

    suppose

    class A
    {
    int x;
    }

    class B
    {
    int y;
    }

    I wanted to know if there is a way tht we can check if like B has x(integer) in it or whether A has y(integer) in it..
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Not unless your compiler implements some kind of runtime type information (RTTI).
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice