C Programming - Complicated Declarations - Discussion

4. 

What do the following declaration signify?

char *arr[10];

[A]. arr is a array of 10 character pointers.
[B]. arr is a array of function pointer.
[C]. arr is a array of characters.
[D]. arr is a pointer to array of characters.

Answer: Option A

Explanation:

No answer description available for this question.

Rajeshwari said: (Oct 18, 2013)  
It is a array of 10 character pointer.

Piyush Pilare said: (Aug 8, 2014)  
I think answer should be D.
arr is a pointer to array of characters.

Yankaiming said: (Jul 8, 2015)  
I think so. It is arr is a pointer to array of characters.

Ankit Aggarwal said: (Jul 31, 2015)  
No, the answer is A.

Because char*arr[10];

Is not pointer to array but it is array of pointer?

Pointer to array can be written as: char (*arr) [10];

Halchal said: (Mar 6, 2016)  
It is an array of 10 pointers to character.

Sai said: (Mar 2, 2017)  
Thanks @Ankit.

Joe said: (Mar 9, 2017)  
Great explanation, Thanks @Ankit.

Vanitha Attada said: (Jun 2, 2017)  
Yes, it is an array of pointers.

If we assigned one pointer to array of 3 chars then char (*ptr) [3],

If ptr is an array of 3 pointers to char then char *ptr[3].

Anitha Devi said: (Aug 8, 2019)  
Thank you @Ankit.

Asmita said: (Jun 17, 2021)  
It is a array of 10 character pointer.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.