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 / arun pateel
Answer is b
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are inline functions? What is the syntax for defining an inline function?
When there is a global variable and local variable with the same name, how will you access the global variable?
What is a far pointer? where we use it?
What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
How do you clear a buffer in c++?
What do you mean by enumerated data type?
What is the use of :: operator in c++?
Which is better turbo c++ or dev c++?
Can you pass a vector to a function?
What is &x in c++?
Where must the declaration of a friend function appear?
When are exception objects created?
What are destructors?
Is c++ the most powerful language?