How do I check what type of variable a variable is?
Something like; if (typecheck(foo,int))
{
/* lol */
}
Name:
Anonymous2008-03-20 5:49
>>25
Thanks, fixed it so it doesn't segfault: char*
allocate_type(type, length)
char type;
unsigned int length;
{
int* ret = malloc(length);
*(ret - 3) = type; /* block size is stored at -2 and -1 */
return ret;
}