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

Which are low level languages?

630


Are the outer parentheses in return statements really optional?

570


Do you know the use of fflush() function?

595


What is a void pointer? When is a void pointer used?

619


Which is better between malloc and calloc?

667






What is printf () in c?

578


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.

1590


What is the difference between char array and char pointer?

525


What is c variable?

549


Which is better pointer or array?

597


What is the process to create increment and decrement stamen in c?

585


What are the rules for identifiers in c?

584


Explain built-in function?

590


What is infinite loop?

625


What will be your course of action for a push operation?

663