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


Please Help Members By Posting Answers For Below Questions

Explain method of creating object in C++ ?

684


Is swift faster than c++?

645


How would you obtain segment and offset addresses from a far address of a memory location?

703


What is searching? Explain linear and binary search.

666


Explain the difference between c & c++?

681






Can I learn c++ without c?

756


What is the benefit of c++?

694


What is a static member?

692


the first character in the variable name must be an a) special symbol b) number c) alphabet

701


Is nan a c++?

719


Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work

699


What is the difference between a declaration and a definition?

664


How do you master coding?

672


What is the use of setprecision in c++?

618


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1529