What is the real difference between arrays and pointers?

Answers were Sorted based on User's Feedback



What is the real difference between arrays and pointers?..

Answer / guest

Arrays automatically allocate space which is fixed in size and
location; pointers are dynamic.

Is This Answer Correct ?    202 Yes 25 No

What is the real difference between arrays and pointers?..

Answer / santosh

array is refered directly to the elements.
but in pointers we refers to address of the elements but not
elements . indirect calling of the elements.

Is This Answer Correct ?    155 Yes 26 No

What is the real difference between arrays and pointers?..

Answer / pravinash

array is collection of similar datatype. it is a static
memory allocation means we can not increment and decrement
the arry size once we allocated. and we can not increment
the base address, reassign address.

pointer is a dynamic memory allocation. we can allocate the
size as we want, assigning into another variable and base
address incrementation is allowed.

Is This Answer Correct ?    72 Yes 9 No

What is the real difference between arrays and pointers?..

Answer / 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

What is the real difference between arrays and pointers?..

Answer / pushpanjali panda

Arrays automatically allocate space, but can't be relocated
or resized. Pointers must be explicitly assigned to point
to allocated space (perhaps using malloc), but can be
reassigned (i.e. pointed at different objects) at will, and
have many other uses besides serving as the base of blocks
of memory.

Is This Answer Correct ?    56 Yes 9 No

What is the real difference between arrays and pointers?..

Answer / siddhartha

Arrays allocate the memory space which cannot resized or
reassigned. But in case of pointers the memory size can be
resized

Is This Answer Correct ?    42 Yes 8 No

What is the real difference between arrays and pointers?..

Answer / tapan

Array is slow compare to pointer

Is This Answer Correct ?    46 Yes 16 No

What is the real difference between arrays and pointers?..

Answer / swetha.j.n

Array is a group of elements.But pointer is not a group of
elements.
Array refer to the data in memory location.But pointer
refer to the address in memory location.

Is This Answer Correct ?    21 Yes 2 No

What is the real difference between arrays and pointers?..

Answer / rag

ARRAYS are allocated at compile time.
POINTERS are alocated at run time.
USE POINTERS FOR PROGRAM EFFICIENCY,BECAUSE MEMORY IS
PRECIOUS ONE. So to reduce memory use pointers.

Is This Answer Correct ?    16 Yes 3 No

What is the real difference between arrays and pointers?..

Answer / sankar s

array refer data in memory location , pointer refer address
to the memory location ,pointer refer the pointee
int *a;
int b[10];
a=&b;
where a is the pointer array b is pointee which point out
the starting memory location of an array.

Is This Answer Correct ?    24 Yes 13 No

Post New Answer

More C Interview Questions

What oops means?

0 Answers  


Explain the priority queues?

0 Answers  


How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?

1 Answers  


What is wrong with this code such that it doesnt produce the input reversed? #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char Space = ' '; char LineOfText; float count; LineOfText = getchar(); while ((LineOfText = getchar()) != '/n'); { count = strlen(LineOfText) - 1; while (count >= 0) { putchar(LineOfText[count]); count--; } } getchar(); return 0; }

2 Answers  


How can I handle floating-point exceptions gracefully?

0 Answers  






union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",ch[10]); }

3 Answers  


explain what is a newline escape sequence?

0 Answers  


Write a program to check palindrome number in c programming?

0 Answers  


What is static identifier?

0 Answers   TCS,


What are the types of pointers?

0 Answers  


how the compiler treats any volatile variable?Explain with example.

1 Answers   Tata Elxsi,


Which is the best website to learn c programming?

0 Answers  


Categories