How do I declare a pointer to an array?
Answers were Sorted based on User's Feedback
Answer / sureshreddy
data_type (*ptr)[];
ex: int (*ptr)[10];
pointer to arry of 10 elements
| Is This Answer Correct ? | 14 Yes | 3 No |
Answer / chittaranjan
int (*ptr)[10];
is the proper declaration of pointer to an array, i.e. ptr
is a pointer to an array of 10 integers .
Note:
int *ptr[10];
which would make ptr the name of an array of 10 pointers to
type int.
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / guest
could any one help me out how this pointer to an array
organized in the memory?
Eg.,
int (*p) [3] = (int (*)[3])a;
Here *p == p, how?
Thanks in advance!
| Is This Answer Correct ? | 3 Yes | 4 No |
Answer / k.thejonath
char (*)p[100];
Here p is a pointer to an array of 100 character elements..
| Is This Answer Correct ? | 6 Yes | 11 No |
What is the meaning of 2d in c?
What is sizeof int in c?
What are the data types present in c?
What does the characters “r” and “w” mean when writing programs that will make use of files?
why array index always starts from zero??
what is the difference between c and c++?
What is hashing in c language?
What are the various types of control structures in programming?
Can anyone tell what is stack overflow? what precaution we should take?
Find the highest of three numbers and print them using ascending orders?
Explain what is the purpose of "extern" keyword in a function declaration?
What are static functions?