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
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Write a program of advanced Fibonacci series.
Explain the term printf() and scanf() used in c language?
What does calloc stand for?
Process by which one bit pattern in to another by bit wise operation is?
What is the difference between exit() and _exit() function?
Is it possible to have a function as a parameter in another function?
given post order,in order construct the corresponding binary tree
How can my program discover the complete pathname to the executable from which it was invoked?
What is the difference between near, far and huge pointers?
Are local variables initialized to zero by default in c?
Write a program to print fibonacci series without using recursion?
What are the different types of C instructions?
How can I read in an object file and jump to locations in it?
What is meant by int main ()?