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
What is the identity function in c++? How is it useful?
What are disadvantages of pointers?
Why do you use the namespace feature?
What are guid?
What are the unique features of C++.
Explain about templates of C++.
What are virtual constructors/destructors?
Show the declaration for a static function pointer.
What are pointers used for c++?
Can you Mention some Application of C/C++?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
How to get the current position of the file pointer?
What is the use of 'using' declaration in c++?
What is pair in c++?
Why do we use classes in c++?