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 mutable storage class specifier.

637


What is the basic structure of c++ program?

571


Can you pass a vector to a function?

540


What are the differences between new and malloc?

633


What are the c++ access specifiers?

777






What is the purpose of template?

613


Write about c++ storage classes?

757


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

616


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

547


write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)

1808


Which c++ operator cannot overload?

555


What is virtual methods?

663


Do you know the problem with overriding functions?

574


What are c++ manipulators?

612


What's the most powerful programming language?

601