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 / manish podiyal

C): outputs the address of v.

Is This Answer Correct ?    1 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is class definition in c++ ?

632


What are the 2 main types of data structures?

590


Which programming language is best?

558


What are namespaces in c++?

601


What is the difference between *p++ and (*p)++ ?

783






Define the process of error-handling in case of constructor failure?

573


What is a multiset c++?

555


What is a literal in c++?

569


What do you mean by ‘void’ return type?

608


How to get the current position of the file pointer?

556


List the issue that the auto_ptr object handles?

613


Which programming language is best to learn first?

585


describe private access specifiers?

645


What are vtable and vptr?

625


What are the advantages of using const reference arguments in a function?

622