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
What does %d do in c?
What is bubble sort in c?
Tell me the use of bit field in c language?
What is difference between union and structure in c?
List some basic data types in c?
What is meant by preprocessor in c?
How can a number be converted to a string?
What is the scope of local variable in c?
differentiate built-in functions and user – defined functions.
What is the best way of making my program efficient?
What is an lvalue?
Can we increase size of array in c?
What is a pointer variable in c language?
How can you call a function, given its name as a string?
What is the heap in c?