Passing variable type as function parameter

Viewed 43052

Is it possible to pass variable type as part of a function parameter, e.g.:

void foo(varType type)
{
  // Cast to global static
  unsigned char bar;
  bar = ((type *)(&static_array))->member;
}

I remember it has something to do with GCC's typeof and using macros?

4 Answers
Related