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
How do I get an accurate error status return from system on ms-dos?
What does the function toupper() do?
How the c program is executed?
What is the purpose of realloc()?
Explain the process of converting a Tree into a Binary Tree.
What is a constant and types of constants in c?
Is file a keyword in c?
Is this program statement valid? INT = 10.50;
Differentiate between the expression “++a” and “a++”?
What is the function of this pointer?
How is actual parameter different from the formal parameter?
What are compound statements?
application attempts to perform an operation?
What is calloc in c?
What are the disadvantages of a shell structure?