which of 'arrays' or 'pointers' are faster?
Answers were Sorted based on User's Feedback
array is faster than pointer because accessing array elements
by pointers always faster.there is used one array and more pointer.we know pointer is a "value at address".
so pointers stores only address of variable but arrays are stores similar data types.
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / andeep singh
Pointer is faster than array if there is only one pointer used
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / narendra
arrays are very faster because it stores a sequential
block of memory and similar data types
pointers stores only adders of variable
but arrays are stores similar data types
| Is This Answer Correct ? | 9 Yes | 4 No |
Answer / sandeep
when compared pointers work fast ,beacause:
1.array too is pointer
eg:char s[20];
gets(s);
here we are supplying base address.
2.array notation will be inter coverted as pointers
where we can directly use pointers.
| Is This Answer Correct ? | 0 Yes | 0 No |
Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?
What are local and global variables?
How do I create a directory? How do I remove a directory (and its contents)?
How do you define CONSTANT in C?
Can we change the value of constant variable in c?
What are local static variables? How can you use them?
what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }
Explain what is the benefit of using an enum rather than a #define constant?
How to swap 3 numbers without using 4th variable?
How can I find out how much memory is available?
What is the difference between malloc() and calloc()?
How can I access an I o board directly?