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 |
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
4.A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above
What is a segmentation fault?
How can I prevent another program from modifying part of a file that I am modifying?
What is null character in c?
which type of aspect you want from the student.
How does the C program handle segmentation faults?
How to write a code for random pick from 1-1000 numbers? The output should contain the 10 numbers from the range 1-1000 which should pick randomly, ie ,for each time we run the code we should get different outputs.
What is break in c?
When should a type cast not be used?
write a program in 'c' to find the value of p[i+1]^n.p,i,n are arguments of a macro and n is a integer
what is a stack