int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why?
Answer Posted / sethuu
First output will print some garbage value because you
delete the object p and the you print.
The second one will print value 60.
Is This Answer Correct ? | 11 Yes | 3 No |
Post New Answer View All Answers
Is using exit() the same as using return?
For what purpose null pointer used?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What does c mean in standard form?
What does void main () mean?
Difference between malloc() and calloc() function?
What's the difference between constant char *p and char * constant p?
What is the difference between union and anonymous union?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What are actual arguments?
What is the purpose of sprintf?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Is null valid for pointers to functions?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
Why cant I open a file by its explicit path?