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 |
Can i use “int” data type to store the value 32768? Why?
Program to find the absolute value of given integer using Conditional Operators
what is the c.
Write a program to generate random numbers in c?
Explain enumerated types.
Explain what is the stack?
write a C and C++ programme to implement the A,bubble sort B,quick sort C,insertion sort D,sequential search E,binary search
If we give two names then this displays the connection between the two people. It is nothing but flames game
What is a null string in c?
Explain how can I convert a string to a number?
Which is better between malloc and calloc?
What are the 4 types of organizational structures?