1. What does the following do:

void afunction(int *x)
{
x=new int;
*x=12;
}
int main()
{
int v=10;
afunction(&v);
cout<<v;
}
a) Outputs 12
b) Outputs 10
c) Outputs the address of v

Answer Posted / ranjeet garodia

b is correct

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the register storage classes in c++.

762


Is it possible for a member function to delete the pointer, named this?

707


Explain what are mutator methods in c++?

671


What is c++ w3school?

736


Define friend function.

656






List the issue that the auto_ptr object handles?

714


Explain Memory Allocation in C/C++ ?

715


What is the best c++ compiler?

678


What is code reusability in c++?

776


How does the copy constructor differ from the assignment operator (=)?

715


What are the characteristics of friend functions?

648


How many types of scopes are there in c++?

661


What is scope resolution operator in c++ with example?

639


What is the difference between structures and unions?

676


Who invented turbo c++?

731