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 difference between big endian form and little endian form? write a code to convert big endian form to little endian and vice versa..
Why is void main used?
can please someone teach me how to create this program using while statement.. this is the output should look like 0 2 4 6 8 10 -thanks.. :) need it asap...
Write a simple code fragment that will check if a number is positive or negative.
What are the standard predefined macros?
int main() { int days; printf("enter days you are late"); scanf("%d",days); if (days<=5) printf("5o paisa fine"); if (days<=10&&days>=6) printf("1rs fine"); if(days>10) printf("10 rs fine"); if(days=30) printf("membership cancelled"); return 0; } tell me whats wrong in this program? is it right?
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
What are linked lists in c?
What are the restrictions of a modulus operator?
write a c/c++ programthat connects to a MYSQL server and checks if the INNoDB plug in is installed on it.If so your program should print the total number of disk writes by MYSQL.
Can you write a programmer for FACTORIAL using recursion?
what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it