C Programming :: Dynamic Memory Allocation - Discussion
Home > C Programming > Dynamic Memory Allocation > MCQs Questions Discussion
17 / 18
What will be output of the following "c" code?
FUNC (int *p)
{
p = (int *)malloc(100);
printf("p:%x",p);
}
int main( )
{
int *ptr;
FUNC(ptr);
printf("Ptr:%x",ptr);
return 0;
}
FUNC (int *p)
{
p = (int *)malloc(100);
printf("p:%x",p);
}
int main( )
{
int *ptr;
FUNC(ptr);
printf("Ptr:%x",ptr);
return 0;
}
ABoth printf statements prints same values
BBoth print different values
CGives compile time error
DGives run time error
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!