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
Can true be a variable name in c?
What is mean by data types in c?
What is the use of parallelize in spark?
What is header file in c?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Explain how do you convert strings to numbers in c?
Differentiate between #include<...> and #include '...'
Write a program to reverse a given number in c?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
What is getche() function?
What is #define used for in c?
ATM machine and railway reservation class/object diagram
The statement, int(*x[]) () what does in indicate?
What is linear search?