int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why?

Answer Posted / anu

I think error will come bcoz memory allocated to *P is
already deleted d it will point to nowhere now....

Is This Answer Correct ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a program flowchart and explain how does it help in writing a program?

659


Explain heap and queue.

574


What does emoji p mean?

589


What is function and its example?

615


how to build a exercise findig min number of e heap with list imlemented?

1599






Can you please explain the scope of static variables?

591


What does sizeof int return?

578


Process by which one bit pattern in to another by bit wise operation is?

608


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

638


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1649


How do you generate random numbers in C?

641


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

599


What is the purpose of the preprocessor directive error?

669


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

643


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

589