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 |
What does *p++ do? What does it point to?
What are the different types of storage classes in C?
What does s c mean in text?
What are inbuilt functions in c?
what is calloc and malloc?
write a c program that prints all multiples of 3between 1 and 50.
Where does the name "C" come from, anyway?
void main() { int a=1; while(a++<=1) while(a++<=2); }
What is #line?
void main() { char c; while(c=getchar()!='\n') printf("%d",c); } o/p=11 why?
what is bitwise operator?
which of the following statements is incorrect a.typedef struct new{ int n1; char n2; } DATA; b.typedef struct { int n3; char *n4; }ICE; c.typedef union { int n5; float n6; } UDT; d.#typedef union { int n7; float n8; } TUDAT;