Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

C | Storage Classes and Type Qualifiers | Question 8

  • Difficulty Level : Medium
  • Last Updated : 09 Feb, 2013


Take a step-up from those "Hello World" programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C course to start learning today.



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

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


Answer: (A)

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :