TCS
Company
Programming
Arrays
What does the following declaration mean?
int (*ptr)[10];
1.ptr is array of pointers to 10 integers
2.ptr is a pointer to an array of 10 integers
3.ptr is an array of 10 integers
4.ptr is an pointer to array
Read Solution (Total 6)
-
- ptr is a pointer to array of 10 integers
- 6 years agoHelpfull: Yes(11) No(0)
- 2nd option
- 6 years agoHelpfull: Yes(1) No(1)
- ptr is a pointer to an array of 10 integers
- 5 years agoHelpfull: Yes(1) No(0)
- int *ptr[10];
This is an array of 10 int* pointers, not as you would assume, a pointer to an array of 10 ints
int (*ptr)[10];
This is a pointer to an array of 10 int
It is I believe the same as int *ptr; in that both can point to an array, but the given form can ONLY point to an array of 10 ints
Source-https://stackoverflow.com/questions/13910749/difference-between-ptr10-and-ptr10 - 5 years agoHelpfull: Yes(1) No(0)
- Ptr is an array of 20 integer
- 6 years agoHelpfull: Yes(0) No(6)
- Option (2) is Correct Answer.
ptr is a pointer to array of 10 integers - 5 years agoHelpfull: Yes(0) No(0)
TCS Other Question