In C11 you can use generic selection. I don't really understand what you want to do however.
#include <stdio.h> #define IS_PTR(x) _Generic((x), int *: 1, int: 0) void main() { int a; int *b; printf("IS_PTR(a) = %d\n", IS_PTR(a)); printf("IS_PTR(b) = %d\n", IS_PTR(b)); }
This outputs
IS_PTR(a) = 0 IS_PTR(b) = 1
on my system.
Edit: For some reason people are downvoting this answer. Although this doesn't work for distinguishing pointers from non-pointers in general, it does work for an arbitrary number of types. It could be good enough for the OP or someone else who stumbles across this question.
The currently topmost answer claims that pointers are just integers "under the hood". Depending on what exactly is meant with "under the hood", that is not entirely correct. (In the end, everything is just integers and floats...)
std::is_pointer? (You did tag the question C++11)