Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C halps

Name: Anonymous 2008-03-19 17:18

How do I check what type of variable a variable is?

Something like;
if (typecheck(foo,int))
  {
  /* lol */
  }

Name: Anonymous 2008-03-19 18:27

>>1
Just cast it to an int and check if it's a valid value, e.g. for a pointer:

if (INT_MIN <= *(*int)foo <= INT_MAX) {
        /* *foo points to an int */
}

Your coding style is horrible, by the way. You really should see an orthodontist about those misplaced braces.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List