C Programming - Complicated Declarations - Discussion
Discussion Forum : Complicated Declarations - General Questions (Q.No. 4)
4.
What do the following declaration signify?
char *arr[10];
Discussion:
10 comments Page 1 of 1.
Asmita said:
2 years ago
It is a array of 10 character pointer.
Anitha Devi said:
4 years ago
Thank you @Ankit.
Vanitha attada said:
6 years ago
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].
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].
Joe said:
6 years ago
Great explanation, Thanks @Ankit.
Sai said:
6 years ago
Thanks @Ankit.
Halchal said:
7 years ago
It is an array of 10 pointers to character.
Ankit aggarwal said:
8 years ago
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];
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];
Yankaiming said:
8 years ago
I think so. It is arr is a pointer to array of characters.
Piyush pilare said:
9 years ago
I think answer should be D.
arr is a pointer to array of characters.
arr is a pointer to array of characters.
Rajeshwari said:
9 years ago
It is a array of 10 character pointer.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers