An array of 3 characters is declares as a pointer this way only.
Anjali said:
(Wed, Aug 3, 2011 11:06:16 PM)
Here we should have 3 characters only but not pointers. To declare any pointer we can have the syntax like char a[3]. So here a is an array which can contain 3 characters. We are asked for pointer to array of 3 characters. So to declare it char (*ptr) [3] is the correct one. Where ptr is a pointer to an array which contains 3.
Ganesh said:
(Thu, Aug 30, 2012 08:57:04 AM)
Here we should have 3 characters only but not pointers. To declare any pointer we can have the syntax like char a[3]. So here a is an array which can contain 3 characters. We are asked for pointer to array of 3 characters. So to declare it char (*ptr) [3] is the correct one. Where ptr is a pointer to an array which contains 3.
Dishendra said:
(Mon, Jun 3, 2013 11:42:13 AM)
See if there was no star symbol then it would have been, array of 3 character. Now since since star is within parenthesis that operation is applied to whole array. So, it is pointer to array of 3 characters.