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 |
Is the below things valid & where it will be stored in memory layout ? static const volatile int i; register struct { } ; static register;
Using which language Test cases are added in .ptu file of RTRT unit testing???
Explain what is the benefit of using #define to declare a constant?
Can u return two values using return keyword? If yes, how? If no, why?
How to explain the final year project as a fresher please answer with sample project
list the no of files created when c source file is compiled
what is the hardware model of CFG( context free grammar)
WHAT IS MEANT BY LIFE?
What is calloc() function?
What is a stream in c programming?
What is void pointers in c?
Why enum is used in c?