Tuesday, August 09, 2005

Behaviour of typeid

code snippet to illustrate behaviour of typeid

struct
{
int side;
}square1;

struct
{
int side;
}square2;


int main(int argc, char *argv[])
{
if(typeid(square1)==typeid(square2))
printf("Same.");
else
printf("Different.");
}

No comments: