Which command is more efficient?
*(ptr+1) or ptr[1]
Answer Posted / poornima
If ptr is declared as a pointer like int *ptr; *(ptr+1) is
more efficient.
If ptr is declared as an array like int ptr[20]; ptr[1] is
more efficient.
So, it depends upon how we r declaring ptr as a pointer or
as an array.
Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Why is c so powerful?
Why do we need functions in c?
Is it cc or c in a letter?
Explain c preprocessor?
Array is an lvalue or not?
can we change the default calling convention in c if yes than how.........?
What is the difference between array and pointer?
What is the difference between class and object in c?
What is pass by reference in c?
When is a null pointer used?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
Give me the code of in-order recursive and non-recursive.
What is the maximum no. of arguments that can be given in a command line in C.?
Is it possible to pass an entire structure to functions?
What is bash c?