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

Answer Posted / hemang

There will be error because del is used instead of delete. in c++ delete is the keyword not del. delete is used to delete an object.

So program will not run....

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is meant by high-order and low-order bytes?

629


Explain what happens if you free a pointer twice?

607


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

1793


Explain what is a pragma?

585


What is floating point constants?

685






What is the process of writing the null pointer?

605


What are header files why are they important?

574


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1583


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

5790


Write a program to swap two numbers without using third variable in c?

612


What is substring in c?

634


Explain what does a function declared as pascal do differently?

634


Can include files be nested? How many levels deep can include files be nested?

651


How can I write a function that takes a format string and a variable number of arguments?

600


Can you please compare array with pointer?

611