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 |
Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod()
what is the defrenece between structure and union
What is difference between array and pointer in c?
Why is c so powerful?
any string of bits of length 'n' represents a unique non- negative integer between.............?
What is a memory leak in structures? How can we rectify that?
Find Error if any in below code, Justify ur answer: struct xx { int a; struct yy { char c; struct xx* p; } struct yy* q; }
What are logical errors and how does it differ from syntax errors?
write a program for 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 4 4
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
Is it better to bitshift a value than to multiply by 2?
where do we use structure pointer?