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 |
the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters
Write a code to generate a series where the next element is the sum of last k terms.
Read two numbers from keyboard and find maximum of them?
How to print "I Love My India" without using semi colon?
WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include<stdio.h> #include<conio.h> void main() { int k=20; printf("%d%d%d%d",k,k++,++k,k); getch(); }
Can a void pointer point to a function?
1. Can we use the for loop this way? for(;i>5;) 2. What is the use of pointers? 3. what is array of pointer? 4. What is the difference between file and database? 5. Define data structure?
How does free() know how many bytes to free?
What is main void in c?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
What does #pragma once mean?
what is the output of below code int x=8,y; x>>=2; y=x; what is y value. NOTE:EXPLANATION IS COMPALSARY with binary bits