What's wrong with "char *p; *p = malloc(10);"?
Answers were Sorted based on User's Feedback
Answer / clay
Here,
After char *p;
since pointer p is not initialized it is pointing at some
unknown location.
In the next step, the address of the memory allocated by
malloc() is stored at some garbage location pointed by p.
Here p is never initialized or never assigned any value.
| Is This Answer Correct ? | 0 Yes | 3 No |
why we use pointer in c
What is string function c?
What is file in c preprocessor?
Write the control statements in C language
Average of a couple 10 years ago was 25. The average remains same after having a child and twins after 3 years. What is the present age of the first child
What are different storage class specifiers in c?
progrem to generate the following series 1 12 123 1234 12345
What are advantages and disadvantages of recursive calling ?
12 Answers College School Exams Tests, Evolving Systems, HP, Jyoti Ltd, Sage, Wipro,
What does a run-time "null pointer assignment" error mean?
In C language, a variable name cannot contain?
What is difference between array and structure in c?
Explain how can I convert a number to a string?