0

I have this program I have to write about adding binary numbers. Here is the write up:

"Defining a binary number as int binNum[8]; write a C++ function

void binaryAdd(int* sum, int& cBit, const int* bin1, const int* bin2)

to compute sum as the sum of the two binary numbers, bin1 and bin2. cBit should be the value of the carry bit after the addition. sum should be the result in binary. For example, if the two binary numbers are 01111111 and 00111111, then sum will be 10111110 and carry will be 0. Test your function with interactive input."

The function cannot be changed. I'm having a hard time with this problem.