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 |
What is function what are the types of function?
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } what is the output?
Write a simple program to find the size of different basic data types in C.
What are the advantages of using macro in c language?
What is s or c?
While compiling a c program,graphics header files are not including in my program..eg: <graphics.h>,what may be the problem...is there any environment settings exists.
write a c program to find biggest of 3 number without relational operator?
How old is c programming language?
char p="data"; printf(p);
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
What does void main return?