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

What does %d do in c?

547


What is bubble sort in c?

640


Tell me the use of bit field in c language?

630


What is difference between union and structure in c?

581


List some basic data types in c?

561






What is meant by preprocessor in c?

537


How can a number be converted to a string?

609


What is the scope of local variable in c?

579


differentiate built-in functions and user – defined functions.

629


What is the best way of making my program efficient?

572


What is an lvalue?

637


Can we increase size of array in c?

543


What is a pointer variable in c language?

646


How can you call a function, given its name as a string?

715


What is the heap in c?

646