Answer Posted / poornima
Nothing wrong.Its fine..
if u hve further doubt run the below code.
#include<stdio.h>
int main()
{
char *p=malloc(10);
if(p==NULL)
{
printf("malloc failed");
exit(0);
}
else
{
printf("malloc success\n");
p="hai";
printf("%s",p);
}
return 0;
}
o/p:
malloc success
hai
| Is This Answer Correct ? | 6 Yes | 10 No |
Post New Answer View All Answers
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
Why do we write return 0 in c?
Do pointers need to be initialized?
Define VARIABLE?
What is structure padding and packing in c?
What is memory leak in c?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
How is actual parameter different from the formal parameter?
What is difference between structure and union in c programming?
What does the error message "DGROUP exceeds 64K" mean?
How can I insert or delete a line (or record) in the middle of a file?
Is it valid to address one element beyond the end of an array?
Explain what is the benefit of using const for declaring constants?
Difference between constant pointer and pointer to a constant.
What is 2 d array in c?