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 |
Two's compliment of -5
What does char * * argv mean in c?
How can I get Single byte from 'int' type variable? Can we alter single bit or multiple bits in int type variable? if so, How?
how to convert binary to decimal and decimal to binary in C lanaguage
7 Answers BPO, Far East Promotions, IBM, RBS,
what is difference between null and nul in c language
Why are algorithms important in c program?
You have an int array with n elements and a structure with three int members. ie struct No { unsigned int no1; unsigned int no2; unsigned int no3; }; Point1.Lets say 1 byte in the array element is represented like this - 1st 3 bits from LSB is one number, next 2 bits are 2nd no and last 3 bits are 3rd no. Now write a function, struct No* ExtractNos(unsigned int *, int count) which extracts each byte from array and converts LSByte in the order mentioned in point1.and save it the structure no1, no2, no3. in the function struct No* ExtractNos(unsigned int *, int count), first parameter points to the base address of array and second parameter says the no of elements in the array. For example: if your array LSB is Hex F7 then result no1 = 7, no2 = 2, no3 = 7. In the same way convert all the elements from the array and save the result in array of structure.
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)
What is the difference function call by value & function call by reference?
Why string is used in c?
what will be the output off the following program? #include<stdio.h> int main() { int a; a=015+0*71+5; printf("%d,a"); return0; }
What is the scope of local variable in c?