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

Difference between declaration and definition of a variable.

558


Is it possible to get the source code back from binary file?

687


What is iterator c++?

521


Describe delete operator?

600


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

564






What is virtual base class uses?

685


What is a c++ vector?

567


What is array give example?

571


What is iomanip c++?

579


Can you pass a vector to a function?

514


what are the iterator and generic algorithms.

1664


Specify some guidelines that should be followed while overloading operators?

594


Why c++ is the best language?

566


What do you mean by function overriding & function overloading in c++?

582


What is #include ctype h in c++?

636