Around line 10, in your flip function you refer to a variable swap: swap[x[k]-'0'];
I does not appear to be defined in that scope.
Flip(&bits[0],9,1); //I suspect my function call is bad
Here you are passing the address of an array of chars, that is, you are passing a char**. Drop the &.
You need to make swap global. So move the declaration from main to the top of the program above Flip(). Also, as it never changes, you make it constant:
Thank you all for helping!
I dropped & but it still not working.
Everything in the code is working except the function call Flip which I had to write but I can"t pass the argument in the function without interfeering with swap.
I did but still no working...I get the error
`swap' undeclared (first use this function)
The program is supposed to work without any changes...I have to only write the function Flip
I tried passing many and sorts of arguments into function but is not working
All you have to do is replace //x[k] = swap[x[k]-'0'];//I commented this out to get an output
with x[k] = '1' - (x[k] - '0');
and replace Flip(&bits[0],9,1); //this is the problem
with Flip(bits, 9, 1);