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
Which are low level languages?
Are the outer parentheses in return statements really optional?
Do you know the use of fflush() function?
What is a void pointer? When is a void pointer used?
Which is better between malloc and calloc?
What is printf () in c?
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.
What is the difference between char array and char pointer?
What is c variable?
Which is better pointer or array?
What is the process to create increment and decrement stamen in c?
What are the rules for identifiers in c?
Explain built-in function?
What is infinite loop?
What will be your course of action for a push operation?