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
What are the advantages of c++ over c?
What are the advantages of using const reference arguments in a function?
Where Malloc(), Calloc(), and realloc() does get memory?
Should I learn c or c++ or c#?
What is the difference between interpreters and compilers?
Is c++ proprietary?
What is diamond problem in c++?
You run a shell on unix system. How would you tell which shell are you running?
What is a far pointer? where we use it?
What do nonglobal variables default to a) auto b) register c) static
Which is better turbo c++ or dev c++?
Out of fgets() and gets() which function is safe to use and why?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
How many ways can a variable be initialized into in C++?
How to implement is-a and has-a class relationships?