That is not a very accurate description of what you are trying to do. If you don't know what you're trying to do yourself, I understand that you can't do it, but if you do know you better tell us.
You don't understand the math? Just say so. Basically, it works pretty much the same as in the decimal system
1)
10001
+01110
=11111
2)
00011
+00011
=00110
Now the steps:
10001
+01110
You start from the right, and add the 2 rightmost digits together - and then keep going left
1+0 = 1 so you write a 1 there
0+1 = 1
0+1 = 1
0+1 = 1
1+0 = 1
so you get 11111
now the other, basically it's the same thing, just now you gotta introduce carries:
chips, that's definitely NOT what he wants to do. ios::binary just means that the stream is a stream of bytes rather than a text stream (which also is a byte stream of course, but formatting and stuff like that is applied here).
This is your task, not mine. The algorithm for doing that is above, just implement that in C++.
PS: Does the task actually require that you to do the addition in the binary system? Cause if not, you could just read 2 strings, parse them so you get two ints, add those and then output the result as a binary number.