What is the real difference between arrays and pointers?
Answer Posted / ajay kumar
The name of the array represents the base address of the array. Thus, the name of the array can be used effectively as any other pointer to an array in accessing the elements of the array.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is character set?
How can I get random integers in a certain range?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
What do you mean by dynamic memory allocation in c?
Why static is used in c?
Does * p ++ increment p or what it points to?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What is call by value in c?
How #define works?
What is the difference between formatted&unformatted i/o functions?
What is the advantage of c?
Can a local variable be volatile in c?
What are the characteristics of arrays in c?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
Why is c faster?