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
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
Why is event driven programming or procedural programming, better within specific scenario?
What does dm mean sexually?
what are the advantages of a macro over a function?
How do you search data in a data file using random access method?
What is c value paradox explain?
What do you know about the use of bit field?
write a program for the normal snake games find in most of the mobiles.
Explain the difference between #include "..." And #include <...> In c?
What is the difference between scanf and fscanf?
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
How can you find the day of the week given the date?
Why is c called c not d or e?
write a programming in c to find the sum of all elements in an array through function.
Can math operations be performed on a void pointer?