C Programming :: Complicated Declarations

NA
SHSTTON
1
Solv. Corr.
0
Solv. In. Corr.
1
Attempted
0 M:0 S
Avg. Time

1 / 7

Declare the following statement?

An array of three pointers to chars.


Achar *ptr[3]();

Bchar *ptr[3];

Cchar (*ptr[3])();

Dchar **ptr[3];

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
2
Solv. Corr.
0
Solv. In. Corr.
2
Attempted
0 M:0 S
Avg. Time

2 / 7

What do the following declaration signify?
int *ptr[30];

Aptr is a pointer to an array of 30 integer pointers.

Bptr is a array of 30 pointers to integers.

Cptr is a array of 30 integer pointers.

Dptr is a array 30 pointers.

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
1
Solv. Corr.
1
Solv. In. Corr.
2
Attempted
0 M:0 S
Avg. Time

3 / 7

Declare the following statement?

A pointer to an array of three chars.


Achar *ptr[3]();

Bchar (*ptr)*[3];

Cchar (*ptr[3])();

Dchar (*ptr)[3];

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
3
Solv. Corr.
9
Solv. In. Corr.
12
Attempted
0 M:0 S
Avg. Time

4 / 7

Interpret the given declaration
char ( * ( f ( )) [ ])()

Af is a pointer to function returning char

Bf is a pointer to an array of function returning a char

CInvalid declaration

Df is a function returning pointer to array[] of pointer to function returning char)

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
4
Solv. Corr.
8
Solv. In. Corr.
12
Attempted
0 M:0 S
Avg. Time

5 / 7

Choose the correct option.

How do u declare a pointer to an array of pointers to int?


Aint *a[5];

Bint **a[5];

Cint *(*a)[5];

Du can not declare

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
5
Solv. Corr.
6
Solv. In. Corr.
11
Attempted
0 M:0 S
Avg. Time

6 / 7

Choose the correct option.

int (*fun())[]


Afunction returning a pointer to an array

Bfunction returning an array of pointers

Cpointer to a funtion which takes array as argument

DCompiler error

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
0
Solv. Corr.
2
Solv. In. Corr.
2
Attempted
0 M:0 S
Avg. Time

7 / 7

Is the below declaration valid?
int* ((*x)())[2];

ATrue

BFALSE

CUndefined behavior

DDepends on the standard

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace