Examveda

What does the following declaration mean?
int (*ptr)[10];

A. ptr is array of pointers to 10 integers

B. ptr is a pointer to an array of 10 integers

C. ptr is an array of 10 integers

D. ptr is an pointer to array

Answer: Option B

Solution (By Examveda Team)

The declaration int (*ptr)[10]; means that ptr is a pointer to an array of 10 integers.

Here's the breakdown:

int specifies the type of elements in the array (integers).
(*ptr) indicates that ptr is a pointer.
[10] specifies that the pointer points to an array of 10 integers.

Thus, ptr is not an array of pointers, nor an array of integers, but a pointer to an array of integers with a size of 10.

This Question Belongs to C Program >> Arrays And Strings

Join The Discussion

Comments (3)

  1. SHEHAM FAZAL
    SHEHAM FAZAL:
    3 years ago

    ptr it is pointer itself and is point to array 10 integer.....

  2. Narendra B
    Narendra B:
    5 years ago

    Explain?

  3. Pooja Kangula
    Pooja Kangula:
    5 years ago

    Explain

Related Questions on Arrays and Strings