Open In App
Related Articles

C | Storage Classes and Type Qualifiers | Question 8

Improve Article
Improve
Save Article
Save
Like Article
Like




#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.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 09 Feb, 2013
Like Article
Save Article
Previous
Next
Similar Reads