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
Specify different types of decision control statements?
Should I learn c or c++ first?
Explain what is polymorphism in c++?
What's the most powerful programming language?
What is searching? Explain linear and binary search.
What is friend class in c++ with example?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
What is the difference between a "copy constructor" and an "assignment operator" in C++?
What is the difference between while and do while loop?
Can we define a constructor as virtual in c++?
How can I learn dev c++ programming?
What's the order in which the objects in an array are destructed?
Const char *p , char const *p What is the difference between the above two?
What are the uses of typedef in a program?
What are advantages of using friend classes?