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
In C, What is the #line used for?
Can we assign integer value to char in c?
Why c is a procedural language?
What is the scope of global variable in c?
How to write a code for reverse of string without using string functions?
What is bss in c?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
Why use int main instead of void main?
Explain high-order and low-order bytes.
What is quick sort in c?
Why c is called procedure oriented language?
What is structure in c explain with example?
Differentiate between a structure and a union.
How do you convert strings to numbers in C?
Explain how do you generate random numbers in c?