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
In the derived class, which data member of the base class are visible?
Why are pointers used?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
Are there any special rules about inlining?
Explain the concept of copy constructor?
What is an arraylist c++?
What is namespace std; and what is consists of?
What do you mean by friend class & friend function in c++?
Who was the creator of c++?
What is the error in the code below and how should it be corrected?
Explain rtti.
How do you differentiate between overloading the prefix and postfix increments?
Can union be self referenced?
What is the best it certification?
How would you call C functions from C++ and vice versa?