Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any difference between __typeof and typeof?

Tags:

c++

c

There are more operators that work when we add __ to them too. what does __ mean?

like image 881
a-z Avatar asked Oct 01 '11 07:10

a-z


People also ask

What is __ typeof __ in C?

The __typeof__ operator returns the type of its argument, which can be an expression or a type. The language feature provides a way to derive the type from an expression. Given an expression e , __typeof__(e) can be used anywhere a type name is needed, for example in a declaration or in a cast.

What does typeof () in C return?

In other languages, such as C# or D and, to some degree, in C (as part of nonstandard extensions and proposed standard revisions), the typeof operator returns the static type of the operand. That is, it evaluates to the declared type at that instant in the program, irrespective of its original form.

What is Library of typeof in C?

The typeof keyword is a new extension to the C language. The Oracle Developer Studio C compiler accepts constructs with typeof wherever a typedef name is accepted, including the following syntactic categories: Declarations.


1 Answers

An identifier with double underscores is reserved for the implementation. typeof is a compiler specific extension to the language, so naming it __typeof ensures no user code has an identifier with the same name

like image 82
Dennis Zickefoose Avatar answered Oct 17 '22 14:10

Dennis Zickefoose