Has a way to get the datatype in C?

For example:

```

int foo;

if (foo is int)
{
    // do something
}

```

or something like:

```

if (typeof(foo) == typeof(int))
{
    // do something
}

```

Thanks in advance.
['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/']
This is called type introspection or reflection and is not supported by the C language. You would probably have to write your own reflection library, and it would be a significant effort.
There is a `typeof` extension in GCC, but it's not in ANSI C: <http://tigcc.ticalc.org/doc/gnuexts.html#SEC69>