1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    Not unless your compiler implements some kind of runtime type information (RTTI).
     

Share This Page