Extension: Typeof

Example

int x = 2;
typeof(x) y;

y = x;

Syntax & Semantics

The new type specifier typeof(E) specifies the type of the expression E. This is a GNU C extension added to make writing macros easier. In the example, y is declared to have the same type as x.

See also the automatic declaration extension.

Implementation

Not implemented in A.

Was implemented in both earlier rscc versions. Evaluated type of the expression and then returned it.