GATE | GATE-CS-2000 | Question 49

The following C declarations

filter_none

edit
close

play_arrow

link
brightness_4
code

struct node
{
   int i;
   float j;
};
struct node *s[10] ;

chevron_right


define s to be

(A) An array, each element of which is a pointer to a structure of type node
(B) A structure of 2 fields, each field being a pointer to an array of 10 elements
(C) A structure of 3 fields: an integer, a float, and an array of 10 elements
(D) An array, each element of which is a structure of type node.


Answer: (A)

Explanation:



// The following code declares a structure
struct node
{
   int i;
   float j;
};

// The following code declares and defines an array s[] each 
// element of which is a pointer to a structure of type node
struct node *s[10] ;


Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.