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
How can I write functions that take a variable number of arguments?
What is non linear data structure in c?
Write a code to remove duplicates in a string.
What Is The Difference Between Null And Void Pointer?
write a c program to find the sum of five entered numbers using an array named number
What is methods in c?
What is table lookup in c?
What is the importance of c in your views?
explain what is a newline escape sequence?
Linked lists -- can you tell me how to check whether a linked list is circular?
What is include directive in c?
Differentiate fundamental data types and derived data types in C.
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
what are the facialities provided by you after the selection of the student.