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
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is the difference between exit() and _exit() function in c?
What is c preprocessor mean?
What are variables and it what way is it different from constants?
Describe wild pointers in c?
What is the scope of global variable in c?
What are the similarities between c and c++?
What is the explanation for cyclic nature of data types in c?
What is line in c preprocessor?
What is register variable in c language?
What does the c in ctime mean?
Write a program to maintain student’s record. Record should
not be available to any unauthorized user. There are three
(3) categories of users. Each user has its own type. It
depends upon user’s type that which kind of operations user
can perform. Their types and options are mentioned below:
1. Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record)
2. Super Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record, Delete Single Record)
3. Guest
(Search Record [by Reg. No or Name], View All Records)
When first time program runs, it asks to create accounts.
Each user type has only 1 account (which means that there
can be maximum 3 accounts). In account creation, following
options are required:
Login Name: <6-10 alphabets long, should be unique>
Password: <6-10 alphabets long, should not display
characters when user type>
Confirm Password:
If errno contains a nonzero number, is there an error?
What is a spanning Tree?
What is a class c rental property?