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 explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What is line in c preprocessor?
How can I ensure that integer arithmetic doesnt overflow?
Why dont c comments nest?
What are keywords in c with examples?
Compare and contrast compilers from interpreters.
What is the use of typedef in structure in c?
Why isnt there a numbered, multi-level break statement to break out
What does sizeof function do?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
What is the difference between the = symbol and == symbol?
What are the two types of functions in c?
Why is c called a mid-level programming language?
How can I get the current date or time of day in a c program?