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
What is a program flowchart and explain how does it help in writing a program?
Explain heap and queue.
What does emoji p mean?
What is function and its example?
how to build a exercise findig min number of e heap with list imlemented?
Can you please explain the scope of static variables?
What does sizeof int return?
Process by which one bit pattern in to another by bit wise operation is?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
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.
How do you generate random numbers in C?
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
What is the purpose of the preprocessor directive error?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
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.