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
Explain the difference between exit() and _exit() function?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
can any one provide me the notes of data structure for ignou cs-62 paper
What is the sizeof () a pointer?
What is the use of define in c?
Was 2000 a leap year?
How many types of arrays are there in c?
Why malloc is faster than calloc?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What are header files in c?
What is far pointer in c?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What are the types of macro formats?
How can I prevent another program from modifying part of a file that I am modifying?
Explain about block scope in c?