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 |
Explain the difference between structs and unions in c?
Binary tree traversing
Explain what are reserved words?
What is the difference between File pointer and Internal Charecter Pointer?
#include<stdio.h> #include<conio.h> int main() { int a[4][4]={{5,7,5,9}, {4,6,3,1}, {2,9,0,6}}; int *p; int (*q)[4]; p=(int*)a; q=a; printf("\n%u%u",p,q); p++; q++; printf("\n%u%u",p,q); getch(); return 0; } what is the meaning of this program?
What is the purpose of macro in C language?
hi, which software companys will take,if d candidate's % is jst 55%?
Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.
What are the disadvantages of c language?
Differentiate between a for loop and a while loop? What are it uses?
There is a 100-story building and you are given two eggs. The eggs (and the building) have an interesting property that if you throw the egg from a floor number less than X, it will not break. And it will always brake if the floor number is equal or greater than X. Assuming that you can reuse the eggs which didn't broke; you got to find X in a minimal number of throws. Give an algorithm to find X in minimal number of throws.
an algorithem for the implementation of circular doubly linked list