Practice mode C Language

What does the declaration typedef unsigned long ulong; do in C?

Correct answer A. It creates ulong as another name for the existing type unsigned long

Explanation

typedef introduces an alias, not a new type: ulong and unsigned long are fully interchangeable. It is handled by the compiler, unlike a #define, which is plain text substitution by the preprocessor. Without the typedef keyword the same line would declare a variable. typedef is widely used to shorten struct types and function pointer types.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.