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


Please Help Members By Posting Answers For Below Questions

How do I send escape sequences to control a terminal or other device?

604


What is the difference between malloc() and calloc()?

610


Explain the difference between the local variable and global variable in c?

593


What is the difference between the local variable and global variable in c?

524


What is || operator and how does it function in a program?

622






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

628


What does %p mean?

586


What is the purpose of void pointer?

590


can anyone suggest some site name..where i can get some good data structure puzzles???

1639


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

625


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

1882


What is call by value in c?

551


What is the best style for code layout in c?

628


What does *p++ do? What does it point to?

608


What is the difference between printf and scanf in c?

743