Manual browser: typeof(3)
TYPEOF(3) | Library Functions Manual | TYPEOF(3) |
NAME
typeof — GNU extension for type of an expressionSYNOPSIS
typetypeof(expression);
DESCRIPTION
The typeof() construct can be used to obtain the type of an expression. The syntax is comparable to that of sizeof(), but semantically typeof() operates like a type name defined with typedef.EXAMPLES
The following is a typical example of a type-generic macro:
#define MAX(a, b) ({ \ typeof(a) _a = (a); \ typeof(b) _b = (b); \ _a > _b ? _a : _b; \ })
CAVEATS
The typeof() construct is a non-standard, compiler-specific extension.December 19, 2010 | NetBSD 7.0 |