edited by
19,248 views
41 votes
41 votes

The following C declarations:

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

define s to be:

  1. An array, each element of which is a pointer to a structure of type node
  2. A structure of $2$ fields, each field being a pointer to an array of $10$ elements
  3. A structure of $3$ fields: an integer, a float, and an array of $10$ elements
  4. An array, each element of which is a structure of type node
edited by

5 Answers

2 votes
2 votes

the answer would be the option a because 

 

struct node 

s[10]---------------> precedence 1---------------------> array 

*  -------------------> precedence 2--------------------->pointer 

now according to precedence, we can say

An array, each element of which is a pointer to a structure of type node

 

 

 

http://www.difranco.net/compsci/C_Operator_Precedence_Table.htm

 

Answer:

Related questions

52 votes
52 votes
3 answers
2
Kathleen asked Sep 14, 2014
11,907 views
The most appropriate matching for the following pairs$$\begin{array}{|ll|ll|}\hline X: & \text{m = malloc(5); m = NULL;} & 1: & \text{using dangling pointers} \\\hline Y...
29 votes
29 votes
2 answers
3
Kathleen asked Sep 14, 2014
15,055 views
The value of $j$ at the end of the execution of the following C program:int incr (int i) { static int count = 0; count = count + i; return (count); } main () { int i, j; ...
42 votes
42 votes
9 answers
4
Kathleen asked Sep 14, 2014
24,750 views
Aliasing in the context of programming languages refers tomultiple variables having the same memory locationmultiple variables having the same valuemultiple variables hav...