C Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 2)
2.
What does the following declaration mean?
int (*ptr)[10];
ptr is array of pointers to 10 integers
ptr is a pointer to an array of 10 integers
ptr is an array of 10 integers
ptr is an pointer to array
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
64 comments Page 4 of 7.

Anonymous said:   7 years ago
Here [10] is Array of 10 integers and (*ptr) is pointer to point 10 Integers and store Addresses of 10 Integers

And here array name is ptr or same as pointer name.

Vijay kanth & prasanth krishna said:   1 decade ago
int (*ptr)[10];
here "ptr" is name of array,[10] is index of that array.
but '*'-it denotes the pointer varable is created of specified name. name-(ptr).

Sanju said:   1 decade ago
Here ptr is the pointer it is represented by using *...! then the symbol [] shows that it is an array and 10 implies the size of that array.

Vishwaschaurasiya said:   1 decade ago
int (*ptr)[10];
ptr is a pointer, but this declaration is called pointer of an array..
Since,(*) this is unary oprator,known as (Astrick);

Subaidha said:   1 decade ago
* means its represent as a pointer variable and here within a array bracket they give us 10 integers.

So that the ans is B.

Amr Gadallah said:   1 decade ago
char *ptr[10]; is an array of 10 pointers to characters.

char (*ptr)[10]; pointer to array of 10 characters.

Vikash kumar said:   1 decade ago
As we know ptr holds the address of variables, and *ptr means what is the value of variables on that address.

Sankar said:   1 decade ago
If any one clear about ptrs please explain clearly. Because I don't understanding anything belong to this.

Yuvraj said:   1 decade ago
Hey, I m not getting difference between array of pointer and pointer of array. Can you please explain me?
(1)

Neeraj awasthi said:   1 decade ago
If () is not there then int *ptr[] start with [] and it means array of pointers of type integers.


Post your comments here:

Your comments will be displayed after verification.