Which command is more efficient?
*(ptr+1) or ptr[1]

Answers were Sorted based on User's Feedback



Which command is more efficient? *(ptr+1) or ptr[1]..

Answer / priya

*(ptr+1)

Is This Answer Correct ?    5 Yes 2 No

Which command is more efficient? *(ptr+1) or ptr[1]..

Answer / purna

*(ptr+1);
Internally the same operation is performed with the next
one also.
it takes less time.

Is This Answer Correct ?    1 Yes 2 No

Which command is more efficient? *(ptr+1) or ptr[1]..

Answer / 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

More C Interview Questions

What is #include in c?

0 Answers  


Why calloc is better than malloc?

0 Answers  


How arrays can be passed to a user defined function

0 Answers  


What is the main differences between C and Embedded C?

9 Answers  


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

0 Answers   Reliance,






Write a program of prime number using recursion.

0 Answers   Aspiring Minds,


Is linux written in c?

0 Answers  


What is enumerated data type in c?

0 Answers  


How can I access a memory located at certain address?

2 Answers   CSC,


What are local variables c?

0 Answers  


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

0 Answers  


What are the commands should be given before weiting C Program i.e, Cd.. like

4 Answers   IBM, Infonet, Satyam, Tech Mahindra,


Categories