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
Can a void pointer point to a function?
Why should I prototype a function?
Define circular linked list.
What is %lu in c?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What is c basic?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Differentiate between a structure and a union.
What is the significance of an algorithm to C programming?
Explain how can I manipulate strings of multibyte characters?
how could explain about job profile
What is the correct code to have following output in c using nested for loop?
Explain 'far' and 'near' pointers in c.
Explain what is a const pointer?
Discuss the function of conditional operator, size of operator and comma operator with examples.