what would be the output of the following program
main()
{
int a[] = {1,2,3,4,5};
int *ptr = {a,a+1,a+2,a+3,a+4};
printf("%d %d %d %d",a,*ptr,**ptr,ptr);
}
}
Output:
1.Base address of 'a'
2.Base address of 'a' (Since ptr holds address of the array 'a')
3.Value at the base address of 'a' ie., 1
4.Base address of array of pointers ie., address of 'ptr'
The above answer is valid provided the initialisation of *ptr
should be a array of pointers.
ie., initialisation should be int *ptr[]=
{a,a+1,a+2,a+3,a+4};
Otherwise it leads to compilation error
Is This Answer Correct ? | 0 Yes | 0 No |
Why are all header files not declared in every c program?
write a program to find lcm and hcf of two numbers??
Can a variable be both constant and volatile?
Is c is a low level language?
What is page thrashing?
What is C language Terminator?
Is there sort function in c?
What is the purpose of Scanf Print, getchar, putchar, function?
write a c program for print your name .but,your name may be small letter mean print a capital letter or your name may be capital letter mean print a small letter .example \\enter ur name : sankar The name is: SANKAR (or) enter your name:SAnkar The name is:saNKAR
What is Function Pointer? Explain with example?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
is forign key will be unique key any table or not?