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

if a person is buying coconuts of Rs10,and then sell that coconuts of Rs9,with the loss of one rupee.After that the person became a millaniore.how?

9 Answers   Wipro,


What is main return c?

0 Answers  


CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.

15 Answers  


print ur name without using any semicolon in c/c++....

21 Answers   Bosch, TCS, Wipro,


Write a factorial program using C.

0 Answers   iNautix,






Are there any problems with performing mathematical operations on different variable types?

0 Answers  


Can we change the value of #define in c?

0 Answers  


What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }

1 Answers  


Is c still used?

0 Answers  


How can I do peek and poke in c?

0 Answers  


Define circular linked list.

0 Answers  


What are the advantages of using macro in c language?

0 Answers  


Categories