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 |
sir, i cannot find the way how to write aprogram by using array on queue
Explain what does the function toupper() do?
How can a number be converted to a string?
we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?
main() { int l=6; switch(l) { default:l=l+2; case 4:l=4; case 5:l++; break; } printf("%d",l); }
how can we Declare a variable in c without defining it.
program to find the magic square
Explain how can a program be made to print the line number where an error occurs?
What is the size of empty structure in c?
How can you allocate arrays or structures bigger than 64K?
write a C program to print the program itself ?!
#include<stdio.h> #include<conio.h> void main() { char ch='\356'; printf("%d",ch); } o/p=-18 why?plz.explain