Ask for a string. Create another string of the same size. Iterate through the first one, and for every '1' write a '0' at the same position in the second one (same for '0' s)
....
Don't read it into a char array, read it into a string.
You don't necessarily need to create a second one either, you can just change the original if you no longer need it.