Help with some binary issues

This is a discussion on Help with some binary issues within the C++ Programming forums, part of the General Programming Boards category; My instructor assigned my group to make a simple program to convert any binary into its one's complement by using ...

Help with some binary issues

My instructor assigned my group to make a simple program to convert any binary into its one's complement by using arrays. I know how to do the one's complement; however, I do not have any idea as to what to do or what arrays are. One issue is that the instructor doesn't make sense or when he does, he mumbles so I can't hear anyways.
He gave a piece of starting code but I haven't gotten far. I tried using char instead of strings but that didn't get me anywhere. Any help would greatly be appreciated.

I'll read up on them more. I kind of know what they are and I also know that the code doesn't make sense. This is what my instructor gave to my class and, like I said, he doesn't make sense most of the time

That is true, but he is the only one of two instructors teaching it. I can do one's complement easily enough. 11111111 >> 00000000 or 10101010 >> 01010101. Just replace one's with zero's and vice versa. But the issue I'm having is being able to get elements to be individually replaced by a replace or replace_if.

Like using bool with if statements? I'm trying to do that right now with some code I got from a book but it's hard since I'm just a noob at all this and the code has vectors and stuff... Mainly things I haven't covered yet or don't understand at all...

Wow. Thanks a lot Raigne. You could have tried to explain it to me instead. It works but I'm supposed to use arrays unless for statements are arrays. Now I feel like I cheated... I guess I'll use this as a template while I try to figure out how to use arrays for it instead. But thanks alot Raigne

Well, using the code you gave me, I modified it a little. But I keep on getting an error message saying that I'm corrupting the binary string, or in my case the char. Is there a way for me to get around that issue? Also I don't think I've covered for statements yet. So I tried to avoid using it.