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 |
What oops means?
What is the Purpose of 'extern' keyword in a function declaration?
what is the output of the program?? #include<stdio.h> main ( ) { int a=010,sum=0,tracker: for(tracker=0;tracker<=a;tracker++) sum+=tracker; printf(“ %d\n”,sum); } what is the difference between a=10 and a=010??
what is the output on the screen? int n; n=printf("my name is %d",printf("kiran %d",printf("kumar"))); printf("\n %d \n",n);
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
What does int main () mean?
How can you allocate arrays or structures bigger than 64K?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
why we use pointer in c
15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?
main() {int a=200*200/100; printf("%d",a); }
what is difference between array,strutter,union and pointers
3 Answers CTS, Lovely Professional University, Mannar Company,