+ 1
int a,b;
a= 1,2,3,4,5;
b=(1,2,3,4,5);
cout <<a <<b;
Outputs: 15
How a and b outputs to 1 and 5 respetively?(It is one of the question in c++ belonging to challenge section)
This code will not even get compiled, because a is expected to be an integer and so is b, but what type of a value does b have there ? There should be no outputs but an error.
+ 1
by defining *p1=b , you basically change the variable value that &a carries which is "a". Since *p2 points to the same adress its value gets changed to b as well. Therefore *p1 and *p2 pointers are the same and equal to b which sums up to 13+13=26
+ 1
cout<<a will be 13, because you changed the value to b on whatever was in &a
+ 1
My pleasure ! Nirmalya Bakshi