What is the real difference between arrays and pointers?

Answer Posted / jaroosh

Arrays are simply pointers THAT CANNOT be reassigned, ie,
constant pointers to some memory locations. They do not
"magically preserve" any information about array size or
whatever that some suggest, they are just a type of constant
pointers, nothing more.
For example , the following :
int a[] = {1,23};
a++;
will throw a compiler error, something like : a is not an
Lvalue, which means that you cannot assign or change the
value of a.

Is This Answer Correct ?    64 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain union.

917


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

1803


On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

925


What is the use of sizeof () in c?

779


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

908


Explain the priority queues?

850


Explain what are binary trees?

833


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

911


What is union and structure?

796


How do we make a global variable accessible across files? Explain the extern keyword?

1649


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

849


what type of questions arrive in interview over c programming?

1778


Explain Function Pointer?

901


What does c mean?

778


What is c language in simple words?

826