Interview Question

What is typedef?

typedef gives another name to an existing type.

💡 Concept ✅ Quick Revision ⚙ C

Answer

typedef creates an alias name for an existing type. • It does not create a distinct new type by itself. • It can simplify complex declarators and hide implementation details. • Overusing aliases can also hide important pointer or qualifier information.

💡 C Example

typedef unsigned long UserId; UserId current_user = 42UL;

⚡ Quick Revision

typedef gives another name to an existing type.