main()
{
int ptr[] = {1,2,23,6,5,6};
printf("%d",&ptr[3]-&ptr[0]);
}
Answer Posted / dipak
In int at least 2 bytes are used for size and we know that &ptr[] gives the address of ptr .
&ptr[3]-&ptr[0]
Size of &ptr[3] is 3*2=6 times greater than Size of &ptr[0] is 1*2=2
ptr[0] also have any value that's why I consider it 1
So 6-2=4
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
How do I send escape sequences to control a terminal or other device?
What is the difference between malloc() and calloc()?
Explain the difference between the local variable and global variable in c?
What is the difference between the local variable and global variable in c?
What is || operator and how does it function in a program?
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
What does %p mean?
What is the purpose of void pointer?
can anyone suggest some site name..where i can get some good data structure puzzles???
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
What is call by value in c?
What is the best style for code layout in c?
What does *p++ do? What does it point to?
What is the difference between printf and scanf in c?