Which command is more efficient?
*(ptr+1) or ptr[1]
Answers were Sorted based on User's Feedback
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 |
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 |
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?
What is main return c?
CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.
print ur name without using any semicolon in c/c++....
21 Answers Bosch, TCS, Wipro,
Write a factorial program using C.
Are there any problems with performing mathematical operations on different variable types?
Can we change the value of #define in c?
What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }
Is c still used?
How can I do peek and poke in c?
Define circular linked list.
What are the advantages of using macro in c language?