Predict the output of the below programs.
Difficulty Level: Rookie
There is no problem with the program. It simply creates a user defined type i and creates a variable a of type i.
Output: Compiler Error -> Initialization with incompatible pointer type.
The line typedef int *i makes i as type int *. So, the declaration of a means a is pointer to a pointer. The Error message may be different on different compilers.
One possible correct solution of this code is in Question 4. Also now try this:
Output: Compiler Error -> Multiple Storage classes for a.
In C, typedef is considered as a storage class. The Error message may be different on different compilers.
Please write comments if you find any of the answers/explanations incorrect, or you want to share more information about the topics discussed above.