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 pointer in c?
Is using exit() the same as using return?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Write a program of advanced Fibonacci series.
Simplify the program segment if X = B then C ← true else C ← false
Are negative numbers true in c?
Explain what does the format %10.2 mean when included in a printf statement?
What are the 32 keywords in c?
Is array name a pointer?
24.what is a void pointer? 25.why arithmetic operation can’t be performed on a void pointer? 26.differentiate between const char *a; char *const a; and char const *a; 27.compare array with pointer? 28.what is a NULL pointer? 29.what does ‘segmentation violation’ mean? 30.what does ‘Bus Error’ mean? 31.Define function pointers? 32.How do you initialize function pointers? Give an example? 33.where can function pointers be used?