C | Storage Classes and Type Qualifiers | Question 6

filter_none

edit
close

play_arrow

link
brightness_4
code

#include<stdio.h>
int main()
{
  typedef static int *i;
  int j;
  i a = &j;
  printf("%d", *a);
  return 0;
}

chevron_right


(A) Runtime Error
(B) 0
(C) Garbage Value
(D) Compiler Error


Answer: (D)

Explanation: 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.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up